Skip to content

Commit d070174

Browse files
authored
#242 fix: add nickname dup_check alert message (#313)
1 parent 2966a48 commit d070174

File tree

3 files changed

+22
-66
lines changed

3 files changed

+22
-66
lines changed

App.tsx

Lines changed: 18 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,6 @@ export type AppProps = {
2929
}
3030

3131
const Stack = createNativeStackNavigator();
32-
const useInitialURL = () => {
33-
const [url, setUrl] = useState<string | null>(null);
34-
const [processing, setProcessing] = useState(true);
35-
36-
useEffect(() => {
37-
const getUrlAsync = async () => {
38-
// Get the deep link used to open the app
39-
const initialUrl = await Linking.getInitialURL();
40-
// console.log(initialUrl)
41-
42-
// The setTimeout is just for testing purpose
43-
setTimeout(() => {
44-
setUrl(initialUrl);
45-
setProcessing(false);
46-
}, 1000);
47-
};
48-
49-
getUrlAsync();
50-
}, []);
51-
52-
return {url, processing};
53-
};
5432

5533
const App = (): JSX.Element => {
5634
useEffect(() => {
@@ -59,61 +37,34 @@ const App = (): JSX.Element => {
5937
}, 800);
6038
});
6139

62-
// const navigation = useNavigation<StackNavigationProp<TabProps>>();
63-
64-
// useEffect(() => {
65-
// //IOS && ANDROID : 앱이 딥링크로 처음 실행될때, 앱이 열려있지 않을 때
66-
// Linking.getInitialURL()
67-
// .then((url) => deepLink(url))
68-
69-
// //IOS : 앱이 딥링크로 처음 실행될때, 앱이 열려있지 않을 때 && 앱이 실행 중일 때
70-
// //ANDROID : 앱이 실행 중일 때
71-
// Linking.addEventListener('url', addListenerLink);
72-
73-
// return () => remover()
74-
// })
75-
76-
// const deepLink = (url: any) => {
77-
// console.log('deep', url)
78-
// if (url) {
79-
// console.log(url)
80-
// // navigation.navigate('OTHER_PAGE', { share: url })
81-
// }
82-
// };
83-
84-
// const addListenerLink = ({url}: any) => {
85-
// console.log('listener', url)
86-
// if (url) {
87-
// // navigation.navigate('OTHER_PAGE', { share: url })
88-
// console.log(url)
89-
// }
90-
// };
91-
92-
// const remover = () => {
93-
// Linking.removeAllListeners('url');
94-
// };
95-
96-
const {url: initialUrl, processing} = useInitialURL();
97-
useEffect(() => {
98-
if(initialUrl) Alert.alert(initialUrl!)
99-
}, [])
100-
10140
const linking : LinkingOptions<AppProps> = {
10241
prefixes: ["kakao6f1497a97a65b5fe1ca5cf4769c318fd://"],
10342
config: {
10443
screens: {
10544
Home: {
10645
screens: {
107-
: ':from/:id',
108-
스토리: ':from/:id',
109-
포레스트: ':from/:id'
46+
: '/:id',
47+
스토리: '/:id',
48+
: '/:id',
49+
포레스트: '/:id'
11050
}
11151
},
11252
Login: {}
11353
},
11454
},
11555
};
11656

57+
// const handleOpenURL = ({ url }: any) => {
58+
// const path = url.split('//')[1];
59+
// Alert.alert(path)
60+
// if (path.startsWith('kakao6f1497a97a65b5fe1ca5cf4769c318fd://')) {
61+
// const uri = decodeURIComponent(path.slice(7));
62+
// // navigation.navigate('작업 처리할 컴포넌트', { uri: uri ? uri : '' });
63+
// }
64+
// };
65+
66+
// Linking.addEventListener('url', handleOpenURL);
67+
11768
return (
11869
<GestureHandlerRootView style={{ flex: 1 }}>
11970
<LoginProvider>
@@ -273,7 +224,9 @@ const codePushOptions = {
273224
title: '업데이트하시겠습니까?',
274225
optionalUpdateMessage: '소소한 버그를 수정했어요🐛',
275226
optionalInstallButtonLabel: '업데이트',
276-
optionalIgnoreButtonLabel: '아니요.'
227+
optionalIgnoreButtonLabel: '아니요.',
228+
mandatoryUpdateMessage: '소소한 버그를 수정했어요🐛',
229+
mandatoryContinueButtonLabel: '업데이트'
277230
},
278231
installMode: CodePush.InstallMode.ON_NEXT_RESTART
279232
}

src/common/InputWithLabel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface InputProps extends TextInputProps {
2727
isRequired?: boolean;
2828
//잘못 입력되거나 잘못된 양식일 경우 보여주는 빨간 텍스트
2929
alertLabel?: string;
30+
descriptionLabel?: string;
3031
isAlert?: boolean;
3132
readonly?: boolean;
3233
children?: ReactNode;
@@ -35,6 +36,7 @@ interface InputProps extends TextInputProps {
3536
export default function InputWithLabel({
3637
isAlert,
3738
alertLabel,
39+
descriptionLabel,
3840
isRequired,
3941
containerStyle,
4042
label,
@@ -83,7 +85,7 @@ export default function InputWithLabel({
8385
<Text
8486
style={{ width: "85%", fontSize: 10, lineHeight: 18, color: "#FF4D00" }}
8587
>
86-
{isAlert && alertLabel}
88+
{isAlert && alertLabel}{descriptionLabel && descriptionLabel}
8789
</Text>
8890
{children}
8991
</View>

src/components/mypage/components/option/ChangeForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ export default function ChangeForm({ navigation, route }: StackScreenProps<MyPag
174174
label='닉네임'
175175
alertLabel='이미 사용중인 닉네임입니다'
176176
isAlert={alert}
177+
descriptionLabel={check ? '사용 가능한 닉네임입니다' : ''}
177178
placeholder='닉네임을 입력해주세요'
178179
onChangeText={(e) => { setCheck(false); setForm({ ...form, nickname: e }) }}
179180
onBlur={() => { }}>

0 commit comments

Comments
 (0)