Skip to content

Commit

Permalink
Merge pull request #158 from Dindb-dong/feat/144/MyPage
Browse files Browse the repository at this point in the history
#144 feat, fix: FixMyPage, Updating userData, etc... in description
  • Loading branch information
miikii41 authored Nov 13, 2024
2 parents ab78bc3 + ea918bb commit 0b41e48
Show file tree
Hide file tree
Showing 24 changed files with 3,520 additions and 810 deletions.
10 changes: 8 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ PODS:
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- react-native-render-html (6.3.4):
- React-Core
- react-native-safe-area-context (4.8.2):
- React-Core
- react-native-slider (4.5.0):
Expand All @@ -913,7 +915,7 @@ PODS:
- React-Core
- react-native-splash-screen (3.3.0):
- React-Core
- react-native-webview (13.10.2):
- react-native-webview (13.12.3):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
Expand Down Expand Up @@ -1146,6 +1148,7 @@ DEPENDENCIES:
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-pager-view (from `../node_modules/react-native-pager-view`)
- react-native-render-html (from `../node_modules/react-native-render-html`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- "react-native-slider (from `../node_modules/@react-native-community/slider`)"
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
Expand Down Expand Up @@ -1255,6 +1258,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-image-picker"
react-native-pager-view:
:path: "../node_modules/react-native-pager-view"
react-native-render-html:
:path: "../node_modules/react-native-render-html"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-slider:
Expand Down Expand Up @@ -1357,10 +1362,11 @@ SPEC CHECKSUMS:
react-native-document-picker: 5b97e24a7f1a1e4a50a72c540a043f32d29a70a2
react-native-image-picker: 6c51359eca7a7df9f07e297218c25696eb9da976
react-native-pager-view: d81ab2060b9caf57ca8c3a0d57467ff407cdb825
react-native-render-html: 984dfe2294163d04bf5fe25d7c9f122e60e05ebe
react-native-safe-area-context: 0ee144a6170530ccc37a0fd9388e28d06f516a89
react-native-slider: 7d387c7e8dd0b4c12bf49c975c8666435f082a33
react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
react-native-webview: ef44a80406c863342b11887697bceb84b9ade802
react-native-webview: 073cc0e8eb27c1daa4faac41c7ae1fc8771f9003
React-nativeconfig: d753fbbc8cecc8ae413d615599ac378bbf6999bb
React-NativeModulesApple: 964f4eeab1b4325e8b6a799cf4444c3fd4eb0a9c
React-perflogger: 29efe63b7ef5fbaaa50ef6eaa92482f98a24b97e
Expand Down
2,258 changes: 1,885 additions & 373 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions src/assets/common/Check2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/common/SignUpCompleteModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC, useEffect, useState } from 'react';
import { Modal, View, Text, TouchableOpacity, StyleSheet } from 'react-native';
import { CommonActions, useNavigation, useRoute } from '@react-navigation/native';
import Check from '../assets/common/CheckIcon.svg'
import Check from '../assets/common/Check2.svg'
import { StackNavigationProp } from '@react-navigation/stack';
import { SignInParams } from '../components/Auth/SignIn';
import { SignupModalProps } from '../components/Auth/Signup';
Expand Down Expand Up @@ -37,10 +37,10 @@ const SignupCompleteModal = ({ visible, onClose }: SignupModalProps) => {
onClose(); // 백 버튼 등으로 모달을 닫을 때 처리
}}>
<View style={styles.modalContainer}>
<Check></Check>
<Check />
<Text style={[styles.text, styles.textClr]}>{` `}</Text>
<Text style={[styles.text, styles.textClr]}>{`가입이 완료되었습니다. `}</Text>
<Text style={[styles.upcy, styles.textClr]}>UPCY와 함께 지속가능한 옷장을 만들어봐요!</Text>
<Text style={[styles.upcy, styles.textClr]}>업씨와 함께 지속가능한 옷장을 만들어봐요!</Text>
<TouchableOpacity style={{ position: 'absolute', bottom: 150, flexGrow: 1 }} onPress={handleGoToReformer}>
<View style={styles.rectangleView}>
<Text style={{ fontSize: 16, lineHeight: 24, fontWeight: "600", fontFamily: "Pretendard Variable" }}>리폼러 프로필 등록하기</Text>
Expand Down
12 changes: 7 additions & 5 deletions src/common/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ export default function Request() {
console.warn(url);
throw err;
} else if (err.response.status === 401) {
console.log('Access Token is not valid')
// access 토큰이 만료된 경우 또는 로그인이 필요한 기능의 경우
// 만료된 토큰 : "Given token not valid for any token type"
// 없는 토큰 : "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
removeAccessToken(); // 기존 access token 삭제
// refresh 토큰을 통해 access 토큰 재발급
try {
const response = await axios.post(
url + '/api/user/token/refresh',
'https://upcy.co.kr/api/user/token/refresh',
{
refresh: refreshToken,
},
Expand Down Expand Up @@ -127,17 +128,16 @@ export default function Request() {
});
};

const del = async (path, params, headers) => {
const del = async (path, data, headers) => {
return await defaultRequest(path, async (url, headerValue) => {
const response = await axios.delete(url, {
params: params,

data: data,
headers: {
Authorization: headerValue,
...headers,
},
});
// console.log('request test => ', response);
//console.log('request test => ', response);
return response;
});
};
Expand All @@ -147,7 +147,9 @@ export default function Request() {
const response = await axios.patch(url, data, {
headers: {
Authorization: headerValue,
params:params,
...headers,

},
});
// console.log('request test => ', response);
Expand Down
24 changes: 15 additions & 9 deletions src/components/Auth/BasicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
TouchableOpacity,
TextInput,
Alert,
Text,
} from 'react-native';
import { Body16B, Body16M, Caption11M, Caption14M } from '../../styles/GlobalText';
import styled from 'styled-components/native';
Expand Down Expand Up @@ -254,7 +255,7 @@ export default function BasicForm({ navigation, route }: FormProps) {
flex: 1,
}}>
<InputView
title="이름"
title="이름 *"
value={form.full_name}
setValue={text =>
setForm(prev => {
Expand All @@ -267,7 +268,7 @@ export default function BasicForm({ navigation, route }: FormProps) {
<View style={{ flexDirection: "row", justifyContent: "center", zIndex: 1 }}>
<View style={{ flex: 1, alignContent: "flex-start", flexDirection: "column" }}>
<InputView
title="이메일"
title="이메일 *"
value={form.mail}
setValue={text =>
setForm(prev => {
Expand Down Expand Up @@ -297,7 +298,7 @@ export default function BasicForm({ navigation, route }: FormProps) {
</View>
</View>
<InputView
title="비밀번호"
title="비밀번호 *"
value={form.password}
setValue={text =>
setForm(prev => {
Expand All @@ -314,7 +315,7 @@ export default function BasicForm({ navigation, route }: FormProps) {
/>

<InputView
title="비밀번호 확인"
title="비밀번호 확인 *"
value={checkPw}
setValue={text => setCheckPw(text)}
placeholder="입력해 주세요"
Expand All @@ -328,8 +329,8 @@ export default function BasicForm({ navigation, route }: FormProps) {
}}
/>
<TermsView>
<Caption11M>만 19세 이상입니다. </Caption11M>
<Caption11M style={{ color: PURPLE }}>(필수)</Caption11M>
<Caption11M style={{ color: PURPLE }}>(필수){' '}</Caption11M>
<Caption11M>만 14세 이상입니다. </Caption11M>
<CheckButton
checked={form.agreement?.a ?? false}
onPress={() =>
Expand All @@ -344,8 +345,8 @@ export default function BasicForm({ navigation, route }: FormProps) {
/>
</TermsView>
<TermsView>
<Caption11M style={{ color: PURPLE }}>(필수){' '}</Caption11M>
<Caption11M>서비스 이용약관에 동의합니다.</Caption11M>
<Caption11M style={{ color: PURPLE }}>(필수)</Caption11M>
<CheckButton
checked={form.agreement?.b ?? false}
onPress={() =>
Expand All @@ -360,8 +361,8 @@ export default function BasicForm({ navigation, route }: FormProps) {
/>
</TermsView>
<TermsView>
<Caption11M style={{ color: PURPLE }}>(필수){' '}</Caption11M>
<Caption11M>개인정보 수집 이용에 동의합니다. </Caption11M>
<Caption11M style={{ color: PURPLE }}>(필수)</Caption11M>
<CheckButton
checked={form.agreement?.c ?? false}
onPress={() =>
Expand All @@ -377,8 +378,8 @@ export default function BasicForm({ navigation, route }: FormProps) {
</TermsView>
<TermsView>
<Caption11M>
마케팅 수신 홍보 목적의 개인정보 수집 및 이용에 동의합니다.
(선택){' '}
마케팅 수신 홍보 목적의 개인정보 수집 및 이용에 동의합니다.
</Caption11M>
<CheckButton
checked={form.agreement?.d ?? false}
Expand Down Expand Up @@ -414,6 +415,11 @@ export default function BasicForm({ navigation, route }: FormProps) {
onPress={setAllAgreementsTrue}
/>
</TouchableOpacity>
<View style={{ alignItems: "center", padding: 20 }}>
<Caption11M style={{ color: '#BDBDBD' }}>업시는 회원님의 원활한 서비스 이용에 필요한 정보를
</Caption11M>
<Caption11M style={{ color: '#BDBDBD' }}>적절한 전자적 수단을 통해 제공하고 있습니다.</Caption11M>
</View>
</View>
</View>
</CustomScrollView>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Auth/BasicSignupSplash.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SafeAreaView, View } from 'react-native';
import { GREEN, PURPLE } from '../../styles/GlobalColor';
import CheckIcon from '../../assets/common/CheckIcon.svg';
import CheckIcon from '../../assets/common/CheckIcon2.svg';
import { Body14B, Title20B } from '../../styles/GlobalText';

export default function BasicSignupSplash() {
Expand All @@ -13,7 +13,7 @@ export default function BasicSignupSplash() {
가입이 완료되었습니다.
</Title20B>
<Body14B style={{ color: GREEN }}>
UPCY와 함께 지속가능한 옷장을 만들어봐요!
업씨와 함께 지속가능한 옷장을 만들어봐요!
</Body14B>
</View>
</SafeAreaView>
Expand Down
139 changes: 139 additions & 0 deletions src/components/Auth/DeleteModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import React, { useState } from 'react';
import { Modal, View, Text, TouchableOpacity, StyleSheet, TextInput } from 'react-native';

type DeleteModalProps = {
visible: any;
onClose: () => void;
onEdit: () => void;
onLogout: () => void;
onDeleteAccount: (password: string) => void; // 비밀번호를 전달받는 함수
}

export const DeleteModal = ({ visible, onEdit, onClose, onLogout, onDeleteAccount }: DeleteModalProps) => {
const [showPasswordInput, setShowPasswordInput] = useState(false);
const [password, setPassword] = useState('');

const handleDeletePress = () => { // 계정 삭제 버튼 누르면 호출됨
setShowPasswordInput(true);
};

const handlePasswordSubmit = () => {
onDeleteAccount(password); // 비밀번호 전달 후 함수 호출
setShowPasswordInput(false); // 초기화
setPassword(''); // 비밀번호 초기화
};
return (
<Modal
transparent={true}
animationType="fade"
visible={visible}
onRequestClose={onClose}
>
<TouchableOpacity
style={styles.modalOverlay}
activeOpacity={1}
onPress={onClose}
>
<View style={styles.modalContent}>
{showPasswordInput ? (
<>
<Text style={styles.modalTitle}>계정 삭제를 위해 비밀번호를 입력하세요</Text>
<TextInput
style={styles.input}
placeholder="비밀번호"
secureTextEntry
value={password}
onChangeText={setPassword}
/>
<TouchableOpacity
onPress={handlePasswordSubmit}
style={styles.modalButtonDelete}
>
<Text style={styles.buttonTextDelete}>계정 삭제 확인</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => setShowPasswordInput(false)}>
<Text style={styles.cancelText}>취소</Text>
</TouchableOpacity>
</>
) : (
<>
<TouchableOpacity onPress={onEdit} style={styles.modalButton}>
<Text style={styles.buttonText}>프로필 수정하기</Text>
</TouchableOpacity>
<TouchableOpacity onPress={onLogout} style={styles.modalButton}>
<Text style={styles.buttonText}>로그아웃</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={handleDeletePress}
style={styles.modalButtonDelete}
>
<Text style={styles.buttonTextDelete}>계정 삭제</Text>
</TouchableOpacity>
</>
)}
</View>
</TouchableOpacity>
</Modal>
);
};

const styles = StyleSheet.create({
modalOverlay: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
alignItems: 'flex-end',
},
modalContent: {
width: '50%',
padding: 20,
backgroundColor: 'white',
borderRadius: 10,
position: 'relative',
alignItems: 'center',
top: 90,
},
modalTitle: {
fontSize: 18,
fontWeight: 'bold',
marginBottom: 20,
},
input: {
width: '100%',
padding: 10,
borderWidth: 1,
borderColor: '#DFDFDF',
borderRadius: 5,
marginBottom: 20,
},
modalButton: {
width: '100%',
alignItems: 'center',
borderBottomColor: '#DFDFDF',
borderBottomWidth: 1,
marginBottom: 15,
paddingBottom: 15,
},
modalButtonDelete: {
width: '100%',
alignItems: 'center',
},
buttonText: {
color: '#000000',
fontSize: 16,
},
buttonTextDelete: {
color: '#FF0000',
fontSize: 16,
},
modalCloseButton: {
paddingVertical: 10,
marginTop: 10,
},
cancelText: {
marginTop: 15,
color: '#888',
textDecorationLine: 'underline',
},
});

export default DeleteModal;
Loading

0 comments on commit 0b41e48

Please sign in to comment.