Skip to content

Commit

Permalink
Merge pull request #86 from Amattang/fix/#80-iosQa
Browse files Browse the repository at this point in the history
Fix/#80 ios qa
  • Loading branch information
SJLEE316 authored May 2, 2022
2 parents 381d8c6 + 0fc0ff9 commit 3f6eaaa
Show file tree
Hide file tree
Showing 23 changed files with 82 additions and 64 deletions.
7 changes: 7 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ def googleMapApiKey = properties.getProperty('google.map.key')
// kakao login api key
def kakaoLoginApiKey = properties.getProperty('KAKAO_NATIVE_APP_KEY')

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('amattang.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
ndkVersion rootProject.ext.ndkVersion

Expand Down Expand Up @@ -188,6 +194,7 @@ android {
}
}
release {
minifyEnabled true
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release
Expand Down
3 changes: 3 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
# Add any project specific keep options here:
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }

-keep class com.kakao.sdk.**.model.* { <fields>; }
-keep class * extends com.google.gson.TypeAdapter
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<resources>
<string name="app_name">amattang</string>
<string name="app_name">아맞땅</string>
<string name="kakao_app_key">3d5254ebc91a92469dde7bc04f9c74b1</string>
</resources>
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ MYAPP_RELEASE_STORE_FILE=amattang.keystore
MYAPP_RELEASE_KEY_ALIAS=amattang
MYAPP_RELEASE_STORE_PASSWORD=amattang1!
MYAPP_RELEASE_KEY_PASSWORD=amattang1!

# keytool -genkey -v -keystore amattang.keystore -alias amattang -keyalg RSA -keysize 2048 -validity 10000
8 changes: 6 additions & 2 deletions components/CheckListComponent/ButtonsOfTypeM.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Dispatch, SetStateAction } from 'react';
import React, { Dispatch, SetStateAction, useState } from 'react';
import { Image, Pressable, View } from 'react-native';
import { DefaultText } from '../../CustomText';
import ModalAddress from '../Map/ModalAddress';
Expand All @@ -14,6 +14,8 @@ interface IProps {
}

const ButtonsOfTypeM = ({ checkList }: IProps) => {
const [fullAddress, setFullAddress] = useState<string>('');

// 현재위치 찾기
const navigation = useNavigation<CheckListStackProps>();

Expand All @@ -25,6 +27,7 @@ const ButtonsOfTypeM = ({ checkList }: IProps) => {
lat: position.coords.latitude,
long: position.coords.longitude,
checkList,
setFullAddress,
});
},
(error) => {
Expand All @@ -45,8 +48,9 @@ const ButtonsOfTypeM = ({ checkList }: IProps) => {

return (
<>
<DefaultText style={{ top: 30 }}>{fullAddress}</DefaultText>
<View style={styles.buttonsOfCheckList}>
<ModalAddress />
<ModalAddress setFullAddress={setFullAddress} />
<Pressable
onPress={onMapHandler}
style={[styles.mapInputOfAddress, styles.buttonOfCheckList]}
Expand Down
28 changes: 14 additions & 14 deletions components/CheckListComponent/CheckListComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ function CheckListComponent({
<View style={styles.textWrapWrapper}>
{checkList.question.split(' ').map((word, index) => (
<DefaultText key={index} style={[styles.checkListMainTitle, styles.textWrap]}>
{word}{' '}
{word}
</DefaultText>
))}
</View>

<View style={styles.subTitles}>
{checkList.rule ? (
{checkList.rule !== null && (
<View style={styles.checkListSubTitle}>
<DefaultText style={styles.emoji}>📘 </DefaultText>
<View style={styles.textWrapWrapper}>
Expand All @@ -113,8 +113,8 @@ function CheckListComponent({
))}
</View>
</View>
) : null}
{checkList.description ? (
)}
{checkList.description !== null && (
<View style={styles.checkListSubTitle}>
<DefaultText style={styles.emoji}>👀 </DefaultText>

Expand All @@ -126,37 +126,37 @@ function CheckListComponent({
))}
</View>
</View>
) : null}
)}
</View>
<View style={styles.buttonsOfCheckList}>
{checkList.type === 'A' ? (
{checkList.type === 'A' && (
<ButtonsOfTypeA
isEdit={isEdit}
checkList={checkList}
setCheckLists={setCheckLists}
checkLists={checkLists}
/>
) : null}
{checkList.type === 'B' ? (
)}
{checkList.type === 'B' && (
<ButtonsOfTypeB
isEdit={isEdit}
checkList={checkList}
setCheckLists={setCheckLists}
checkLists={checkLists}
/>
) : null}
{checkList.type === 'C' ? (
)}
{checkList.type === 'C' && (
<ButtonsOfTypeC setModal={setModal} modal={modal} checkList={checkList} />
) : null}
{checkList.type === 'D' ? (
)}
{checkList.type === 'D' && (
<ButtonsOfTypeD
isEdit={isEdit}
checkList={checkList}
setCheckLists={setCheckLists}
checkLists={checkLists}
/>
) : null}
{checkList.type === 'M' ? <ButtonsOfTypeM checkList={checkList} /> : null}
)}
{checkList.type === 'M' && <ButtonsOfTypeM checkList={checkList} />}
</View>
</Pressable>
</Animated.View>
Expand Down
9 changes: 4 additions & 5 deletions components/Login/KakaoLoginBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const KakaoLoginBtn = ({ setIsLogin }: Props) => {
const requestRefresh = (refreshToken: any) => {
axios
.post(`/issue/re`, {
request: 'access / refresh',
request: 'access',
token: `Bearer ${refreshToken}`,
})
.then(onLoginSuccess)
Expand All @@ -50,17 +50,16 @@ const KakaoLoginBtn = ({ setIsLogin }: Props) => {
setAccessToken(accessToken);
} else {
// 처음 호출
accessToken = res_data.accessToken;
setAuthTokens({
accessToken: accessToken,
accessToken: res_data.accessToken,
refreshToken: res_data.refreshToken,
});
}
axios.defaults.headers.common['Authorization'] = `Bearer ${accessToken}`;
setIsLogin(true);
const refreshToken = getRefreshToken().then((refreshToken) => console.log(refreshToken));
// const refreshToken = getRefreshToken();
// accessToken 만료하기 1분 전에 로그인 연장
setTimeout(() => requestRefresh(refreshToken), acessTokenExpiresIn - 60000);
// setTimeout(() => requestRefresh(refreshToken), acessTokenExpiresIn - 60000);
};

const catchError = (err: any) => {
Expand Down
36 changes: 18 additions & 18 deletions components/Map/AddressItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,33 @@ const AddressItem = ({
const checkListContext = useContext(checkListCtx);

const onPressHandler = () => {
checkListContext?.setChoseCheckListByServer({
...checkListContext?.choseCheckListByServer,
typeM: {
questionId: checkList?.questionId,
address: fullAddress,
latitude,
longitude,
},
});

!activeType && setFullAddress(fullAddress);
// const data = {
setFullAddress(fullAddress);
// checkListContext?.setChoseCheckListByServer({
// ...checkListContext?.choseCheckListByServer,
// typeM: {
// questionId: checkList?.questionId,
// address: fullAddress,
// latitude,
// longitude,
// },
// };
// });

const data = {
...checkListContext?.choseCheckListByServer,
typeM: {
questionId: checkList?.questionId,
address: fullAddress,
latitude,
longitude,
},
};

// console.log(`data : ${JSON.stringify(data)}`);
console.log(`data : ${JSON.stringify(data)}`);

// axios
// .put(`/api/check-list/${checkListContext?.checkListId}/common/question`, data)
// .then((res) => console.log(res))
// .catch((err) => console.log(err));
axios
.put(`/api/check-list/${checkListContext?.checkListId}/common/question`, data)
.then((res) => console.log(res))
.catch((err) => console.log(err));

navigation.goBack();
};
Expand Down
15 changes: 9 additions & 6 deletions components/Map/ModalAddress.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import React, { Dispatch, SetStateAction, useContext, useState } from 'react';
import { Alert, Image, Modal, Pressable, Text, View } from 'react-native';
import Postcode from '@actbase/react-daum-postcode';
import { DefaultText } from '../../CustomText';
Expand All @@ -7,12 +7,15 @@ import { OnBoardingStackProps } from '../../types/navigationTypes';
import { styles } from './Modal.style';
import { checkListCtx } from '../../Context/CheckListByServer';

const ModalAddress = () => {
const navigation = useNavigation<OnBoardingStackProps>();
type Props = {
setFullAddress: Dispatch<SetStateAction<string>>;
};

const ModalAddress = ({ setFullAddress }: Props) => {
const navigation = useNavigation<any>();

// @brief 주소검색창 - 데이터 조회
const [isModal, setModal] = useState<boolean>(false);
const [fullAddress, setFullAddress] = useState<string>('직접입력');

return (
<>
Expand All @@ -39,7 +42,7 @@ const ModalAddress = () => {
navigation.navigate('map', {
activeType: false,
address: data.address,
setFullAddress: setFullAddress,
setFullAddress,
});
}}
/>
Expand All @@ -48,7 +51,7 @@ const ModalAddress = () => {
onPress={() => setModal(true)}
style={[styles.directInputOfAddress, styles.buttonOfCheckList]}
>
<DefaultText style={styles.directInputTextOfAddress}>{fullAddress}</DefaultText>
<DefaultText style={styles.directInputTextOfAddress}>직접입력</DefaultText>
</Pressable>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions components/Onboarding/AddressItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { styles } from './AddressItem.style';

type Props = {
address: string | undefined;
setFullAddress: Dispatch<SetStateAction<String>>;
setFullAddress: Dispatch<SetStateAction<string>>;
activeType: boolean;
};

Expand All @@ -28,7 +28,7 @@ const AddressItem = ({ address, setFullAddress, activeType }: Props) => {
<Pressable
onPress={() => {
navigation.goBack();
!activeType && setFullAddress(fullAddress);
setFullAddress(fullAddress);
}}
style={[styles.addressBtn, styles.bottomBtn]}
>
Expand Down
11 changes: 7 additions & 4 deletions components/Onboarding/ButtonOfMap.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import React, { useState } from 'react';
import { Image, Pressable, View } from 'react-native';
import { DefaultText } from '../../CustomText';
import ModalAddress from '../Map/ModalAddress';
import styles from '../../screens/Landing/styles';
import { requestPermission } from '../../utils/LocationPermission';
import Geolocation from 'react-native-geolocation-service';
import { OnBoardingStackProps } from '../../types/navigationTypes';
import { useNavigation } from '@react-navigation/native';

const ButtonOfMap = () => {
const [fullAddress, setFullAddress] = useState<string>('');

// 현재위치 찾기
const navigation = useNavigation();
const navigation = useNavigation<any>();

const goGeoLocation = (): void => {
Geolocation.getCurrentPosition(
Expand All @@ -19,6 +20,7 @@ const ButtonOfMap = () => {
activeType: true,
lat: position.coords.latitude,
long: position.coords.longitude,
setFullAddress,
});
},
(error) => {
Expand All @@ -39,8 +41,9 @@ const ButtonOfMap = () => {

return (
<>
<DefaultText style={{ top: 30 }}>{fullAddress}</DefaultText>
<View style={styles.buttonsOfCheckList}>
<ModalAddress />
<ModalAddress setFullAddress={setFullAddress} />
<Pressable
onPress={onMapHandler}
style={[styles.mapInputOfAddress, styles.buttonOfCheckList]}
Expand Down
9 changes: 4 additions & 5 deletions screens/bottomTab/BottomMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const BottomMap = () => {
axios
.get(`./api/check-list`)
.then((res) => {
console.log(res.data.data);
const newData = res.data.data.filter((list: any) => list.address !== null);
setLocations(newData);
requestPermission().then((result) => {
Expand All @@ -77,7 +76,7 @@ const BottomMap = () => {

return (
<View style={{ flex: 1 }}>
{locations ? (
{locations?.length !== 0 ? (
<MapView
style={{ flex: 1 }}
provider={PROVIDER_GOOGLE}
Expand All @@ -90,7 +89,7 @@ const BottomMap = () => {
zoomEnabled={true}
showsScale={true}
>
{locations.map((marker, idx) => (
{locations?.map((marker, idx) => (
<Marker
coordinate={marker.location}
title={marker.mainTitle}
Expand Down Expand Up @@ -118,7 +117,7 @@ const BottomMap = () => {
showsScale={true}
/>
)}
{locations && locations?.length !== 0 && (
{locations?.length !== 0 && (
<View style={styles.carContainer}>
<Carousel
data={locations}
Expand All @@ -128,7 +127,7 @@ const BottomMap = () => {
layout={'default'}
onSnapToItem={(index) => {
setLocations(
locations.map((marker) =>
locations?.map((marker) =>
marker.order === index
? (setPick(marker.location), { ...marker, center: true })
: { ...marker, center: false }
Expand Down
Loading

0 comments on commit 3f6eaaa

Please sign in to comment.