diff --git a/src/assets/images/arrowGrey10.png b/src/assets/images/arrowGrey10.png new file mode 100644 index 0000000..f3e0185 Binary files /dev/null and b/src/assets/images/arrowGrey10.png differ diff --git a/src/assets/images/arrowGrey8.png b/src/assets/images/arrowGrey8.png new file mode 100644 index 0000000..04dc17c Binary files /dev/null and b/src/assets/images/arrowGrey8.png differ diff --git a/src/assets/images/editPen.png b/src/assets/images/editPen.png new file mode 100644 index 0000000..ddad92c Binary files /dev/null and b/src/assets/images/editPen.png differ diff --git a/src/assets/images/goBack.png b/src/assets/images/goBack.png new file mode 100644 index 0000000..9fa7b85 Binary files /dev/null and b/src/assets/images/goBack.png differ diff --git a/src/assets/images/purpleCircle.png b/src/assets/images/purpleCircle.png new file mode 100644 index 0000000..3cd9aee Binary files /dev/null and b/src/assets/images/purpleCircle.png differ diff --git a/src/components/MyHeader.tsx b/src/components/MyHeader.tsx new file mode 100644 index 0000000..f3ceb8d --- /dev/null +++ b/src/components/MyHeader.tsx @@ -0,0 +1,70 @@ +import React from 'react'; +import type {FC} from 'react'; +import {StyleSheet, Text, TouchableOpacity, View, Image} from 'react-native'; + +export type MyHeaderProps = { + goBack: () => void; + title: string; + save?: () => void; +}; + +export const MyHeader: FC = ({goBack, title, save}) => { + return ( + + + + + + + + {title} + + {save !== undefined ? ( + + 저장 + + ) : ( + + 저장 + + )} + + ); +}; + +const styles = StyleSheet.create({ + headerWrap: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + borderBottomColor: '#DFDFDF', + borderBottomWidth: 1, + height: 41, + backgroundColor: '#FFFFFF', + }, + backButton: { + zIndex: 1, + justifyContent: 'center', + alignItems: 'center', + marginLeft: 16, + }, + headerText: { + fontSize: 17, + color: 'black', + marginLeft: 16, + marginRight: 16, + // fontWeight: '600', + }, + saveButton: { + marginRight: 16, + color: '#6C69FF', + fontSize: 16, + }, + disable: {opacity: 0}, + progressText: { + color: '#949494', + fontSize: 16, + }, +}); diff --git a/src/components/MyNotificationsSwitch.tsx b/src/components/MyNotificationsSwitch.tsx new file mode 100644 index 0000000..7582a53 --- /dev/null +++ b/src/components/MyNotificationsSwitch.tsx @@ -0,0 +1,34 @@ +import React, {useState} from 'react'; +import type {FC} from 'react'; +import {StyleSheet, Text, TouchableOpacity, Switch, View, Image} from 'react-native'; + +export type MyNotificationsSwitchProps = { + text: string; + value: boolean; + onValueChange: () => void; +}; + +export const MyNotificationsSwitch: FC = ({text, value, onValueChange}) => { + return ( + + {text} + + + ); +}; + +const styles = StyleSheet.create({ + eachAlarm: { + height: 68, + backgroundColor: 'white', + alignItems: 'center', + justifyContent: 'space-between', + flexDirection: 'row', + }, +}); diff --git a/src/components/MyUser.tsx b/src/components/MyUser.tsx index 0cba0d1..a13ad48 100644 --- a/src/components/MyUser.tsx +++ b/src/components/MyUser.tsx @@ -1,23 +1,26 @@ -import React, {useState} from 'react'; +import React, {useState, useEffect} from 'react'; import type {FC} from 'react'; import { View, StyleSheet, Text, TouchableOpacity, Image } from 'react-native'; import {Colors} from 'react-native-paper'; +import {useNavigation} from '@react-navigation/native'; export type MyUserProps = { userprofile?: any; //????????? username: string; - userid: number; - status: string; //"start","request","onrequest","success", "review" + userid?: number; //email로 바꼈나? + userEmail: string; + point: number; + status: string; //"identified","unidentified" }; //prettier-ignore -export const MyUser: FC = ({username, userid, status }) => { +export const MyUser: FC = ({username, userEmail, point, status }) => { const [statusMessage, setMessage] = useState(""); - // useEffect(()=>{ - // if (status==='request') {setMessage('미션중')} - // else if (status==='onrequest') {setMessage('사장님 확인중')} - // else if (status==='success') {setMessage('미션 성공')} - // }, [status]); + useEffect(()=>{ + if (status === 'unidentified') {setMessage('미인증')} + else if (status === 'unidentified') {setMessage('')} + }, [status]); + const navigation = useNavigation(); return ( @@ -31,16 +34,30 @@ export const MyUser: FC = ({username, userid, status }) => { {username} - 인증? + {statusMessage} - {userid} + {userEmail} - {/* - - {statusMessage} + navigation.navigate('MyEditUserInfo')}> + + 회원정보 수정 + - */} + + navigation.navigate('MyPoint')} style={[styles.userPoint]}> + + 내 포인트 + {point.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')} + + + ); }; @@ -53,13 +70,14 @@ const styles = StyleSheet.create({ }, userCard: { flexDirection: 'row', + justifyContent: 'center', + alignItems: 'center', + marginTop: 16, + marginBottom: 18, }, profileWrap: { - marginTop: 16, marginLeft: 16, - - marginBottom: 14, - marginRight: 11, + marginRight: 16, }, profileImg: { width: 48, @@ -73,19 +91,23 @@ const styles = StyleSheet.create({ alignItems: 'baseline', }, username: { - flexDirection: 'column', + flexDirection: 'row', + justifyContent: 'center', + alignItems: 'center', }, usernameText: { color: '#111111', fontSize: 16, - marginBottom: 2, + marginRight: 8, + fontWeight: 'bold', }, userauthText: { - color: 'red', + fontSize: 12, + color: '#E03D32', }, - useridText: { - fontSize: 14, - color: '#111111', + userEmail: { + fontSize: 12, + color: '#616161', }, statusWrap: { marginRight: 24, @@ -95,4 +117,23 @@ const styles = StyleSheet.create({ color: '#111111', fontSize: 16, }, + editUserInfo: { + flexDirection: 'row', + marginRight: 16, + justifyContent: 'center', + alignItems: 'center', + }, + userPoint: { + marginLeft: 16, + marginRight: 16, + backgroundColor: '#F6F6FE', + borderRadius: 10, + height: 48, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + }, + MyNextImg: { + marginRight: 20, + }, }); diff --git a/src/components/Register/RegisterEmail.tsx b/src/components/Register/RegisterEmail.tsx new file mode 100644 index 0000000..f7443f4 --- /dev/null +++ b/src/components/Register/RegisterEmail.tsx @@ -0,0 +1,75 @@ +import React, {useState} from 'react'; +import type {FC} from 'react'; +import {StyleSheet, Text, TextInput, View} from 'react-native'; +import {RegisterInterface} from '../../data'; + +type RegisterEmailProps = { + setRegisterData: React.Dispatch>; + registerData: RegisterInterface; + onChange: (...event: any[]) => void; + value: string; + error: boolean; +}; + +export const RegisterEmail: FC = ({ + setRegisterData, + registerData, + onChange, + value, + error, +}) => { + const [focusedName, setFocusedName] = useState(false); + return ( + + 이메일 + { + onChange(text); + setRegisterData({...registerData, email: text}); + }} + value={value} + placeholder="이메일을 입력" + selectionColor={'#6C69FF'} + onBlur={() => setFocusedName(false)} + onFocus={() => setFocusedName(true)} + /> + + ); +}; + +const styles = StyleSheet.create({ + nameWrap: { + marginTop: 20, + }, + nameInput: { + width: '100%', + height: 44, + + borderRadius: 10, + paddingLeft: 8, + paddingRight: 8, + paddingTop: 10, + paddingBottom: 10, + marginTop: 8, + color: '#111111', + }, + errorBorderFocus: {borderColor: '#E03D32', borderWidth: 1}, + errorBorderNoFocus: {borderColor: '#E03D32', borderWidth: 0.5}, + focusBorder: {borderColor: '#6C69FF', borderWidth: 1}, + unfocusBorder: {borderColor: '#DFDFDF', borderWidth: 1}, + formHeadText: { + fontSize: 18, + fontWeight: '600', + marginBottom: 10, + }, +}); diff --git a/src/data/RegisterInterface.ts b/src/data/RegisterInterface.ts index 4321701..8a3c25c 100644 --- a/src/data/RegisterInterface.ts +++ b/src/data/RegisterInterface.ts @@ -14,4 +14,5 @@ export type RegisterInterface = { phone: string; x: string; y: string; + email?: string; }; diff --git a/src/nav/MainNavigator.tsx b/src/nav/MainNavigator.tsx index f87f4e1..e02170f 100644 --- a/src/nav/MainNavigator.tsx +++ b/src/nav/MainNavigator.tsx @@ -6,6 +6,7 @@ Icon.loadFont(); import Main from '../screens/Main'; import Mission from '../screens/Mission'; import MyPage from '../screens/MyPage'; +import {MyNavigator} from './MyNavigator'; import type {RouteProp, ParamListBase} from '@react-navigation/native'; import {MapNavigator} from './MapNavigator'; @@ -43,7 +44,8 @@ export const MainNavigator = () => { - + {/* */} + ); }; diff --git a/src/nav/MyNavigator.tsx b/src/nav/MyNavigator.tsx new file mode 100644 index 0000000..1cc88ee --- /dev/null +++ b/src/nav/MyNavigator.tsx @@ -0,0 +1,35 @@ +import React from 'react'; +import {createStackNavigator} from '@react-navigation/stack'; +import MyPage from '../screens/MyPage'; +import {MyReview} from '../screens/MyReview'; +import {MyNotifications} from '../screens/MyNotifications'; +import {MyInquiry} from '../screens/MyInquiry'; +import {MyEditUserInfo} from '../screens/MyEditUserInfo'; +import {MyPoint} from '../screens/MyPoint'; + +export type MyStackParamList = { + MyPage: undefined; + MyEditUserInfo: undefined; + MyPoint: undefined; + MyReview: undefined; + MyNotifications: undefined; + MyInquiry: undefined; +}; + +const Stack = createStackNavigator(); + +export const MyNavigator = () => { + return ( + + + + + + + + + ); +}; diff --git a/src/screens/MyEditUserInfo.tsx b/src/screens/MyEditUserInfo.tsx new file mode 100644 index 0000000..75b4a4e --- /dev/null +++ b/src/screens/MyEditUserInfo.tsx @@ -0,0 +1,95 @@ +import React, {useState} from 'react'; +import {View, StyleSheet, Image, Text, TouchableOpacity} from 'react-native'; +import type {NativeStackScreenProps} from '@react-navigation/native-stack'; +import {MyStackParamList} from '../nav/MyNavigator'; +import {MyHeader} from '../components/MyHeader'; + +type Props = NativeStackScreenProps; + +export const MyEditUserInfo = ({navigation}: Props) => { + const goBack = () => { + navigation.goBack(); + }; + function editProfileImg() { + console.log('수정'); + } + return ( + + { + console.log('저장'); + }} + /> + + + + + + 라춘식님 + + + + + console.log('탈퇴')} style={{alignItems: 'flex-end'}}> + 계정탈퇴 + + + ); +}; + +const styles = StyleSheet.create({ + flex: {flex: 1}, + userInfoProfile: { + height: 120, + backgroundColor: '#FFFFFF', + marginBottom: 8, + alignItems: 'center', + justifyContent: 'center', + flexDirection: 'column', + }, + profileWrap: { + }, + profileImg: { + width: 70, + height: 70, + borderRadius: 35, + marginBottom: 2, + borderWidth: 1, + borderColor: '#6C69FF', + }, + editPen: { + width: 20, + height: 20, + borderRadius: 10, + position: 'absolute', + left: 53, + top: 45, + }, + usernameText: { + color: '#000000', + fontSize: 16, + // fontWeight: 'bold', + }, + userInfoEdit: { + height: 222, + backgroundColor: '#FFFFFF', + }, + userInfoEditContent: { + marginLeft: 16, + marginRight: 16, + }, + quitText: { + color: '#777777', + fontSize: 14, + marginRight: 16, + marginTop: 8, + }, +}); diff --git a/src/screens/MyInquiry.tsx b/src/screens/MyInquiry.tsx new file mode 100644 index 0000000..c0fd5b3 --- /dev/null +++ b/src/screens/MyInquiry.tsx @@ -0,0 +1,23 @@ +import React, {useState} from 'react'; +import {View, StyleSheet, Text, TouchableOpacity} from 'react-native'; +import type {NativeStackScreenProps} from '@react-navigation/native-stack'; +import {MyStackParamList} from '../nav/MyNavigator'; +import {MyHeader} from '../components/MyHeader'; + +type Props = NativeStackScreenProps; + +export const MyInquiry = ({navigation}: Props) => { + const goBack = () => { + navigation.goBack(); + }; + return ( + + + MyInquiry + + ); +}; + +const styles = StyleSheet.create({ + flex: {flex: 1}, +}); diff --git a/src/screens/MyNotifications.tsx b/src/screens/MyNotifications.tsx new file mode 100644 index 0000000..95f5cda --- /dev/null +++ b/src/screens/MyNotifications.tsx @@ -0,0 +1,82 @@ +import React, {useState} from 'react'; +import {View, StyleSheet, Text, Switch} from 'react-native'; +import type {NativeStackScreenProps} from '@react-navigation/native-stack'; +import {MyStackParamList} from '../nav/MyNavigator'; +import {MyHeader} from '../components/MyHeader'; +// import {MyNotificationsSwitch} from '../components/MyNotificationsSwitch'; + +type Props = NativeStackScreenProps; + +export const MyNotifications = ({navigation}: Props) => { + const goBack = () => { + navigation.goBack(); + }; + const [onNewevent, setOnNewevent] = useState(false); + const [onReview, setOnReview] = useState(false); + const [onInquiry, setOnInquiry] = useState(false); + console.log(onNewevent, onReview, onInquiry); + + return ( + + + + {'새로운 이벤트'} + setOnNewevent(!onNewevent)} + style={{marginRight: 16}} + /> + + + {'리뷰 답변'} + setOnReview(!onReview)} + style={{marginRight: 16}} + /> + + + {'문의 내역 답변'} + setOnInquiry(!onInquiry)} + style={{marginRight: 16}} + /> + + {/* setOnNewevent(!onNewevent)} + /> */} + + ); +}; + +const styles = StyleSheet.create({ + flex: {flex: 1}, + alarmWrap: { + height: 68, + backgroundColor: 'white', + }, + reply: { + height: 68, + backgroundColor: 'white', + }, + inquiry: { + height: 68, + backgroundColor: 'white', + }, + eachNotifications: { + height: 68, + backgroundColor: 'white', + alignItems: 'center', + justifyContent: 'space-between', + flexDirection: 'row', + }, +}); diff --git a/src/screens/MyPage.tsx b/src/screens/MyPage.tsx index ce01038..e05a10e 100644 --- a/src/screens/MyPage.tsx +++ b/src/screens/MyPage.tsx @@ -1,13 +1,14 @@ -import React, {useState} from 'react'; +import React, {useState, useCallback} from 'react'; import {View, StyleSheet, Text, TouchableOpacity} from 'react-native'; import {Colors} from 'react-native-paper'; import AsyncStorage from '@react-native-async-storage/async-storage'; import {MyUser} from '../components/MyUser'; +import {useNavigation} from '@react-navigation/native'; const MyPage = () => { - const [status, setStatus] = useState('request'); //버튼문구 //"start","request","onrequest","success", "review"// + const [status, setStatus] = useState('unidentified'); //인증된 - "identified", 미인증- "unidentified" + const navigation = useNavigation(); - const title = 'MyPage'; const storeData = async (value: string) => { try { await AsyncStorage.setItem('userToken', value); @@ -19,6 +20,7 @@ const MyPage = () => { storeData(''); }; console.log(AsyncStorage.getItem('userToken')); + return ( @@ -26,14 +28,25 @@ const MyPage = () => { 마이페이지 - - - - - {title} + + navigation.navigate('MyReview')}> + + 작성한 리뷰 + + + navigation.navigate('MyNotifications')}> + + 알림 설정 + + + navigation.navigate('MyInquiry')}> + + 1:1 문의 + + - - 로그아웃 + + 로그아웃 @@ -46,10 +59,9 @@ const styles = StyleSheet.create({ width: '100%', borderBottomColor: '#DFDFDF', borderBottomWidth: 1, - marginBottom: 8, }, header: { - height: 40, + height: 41, backgroundColor: '#FFFFFF', justifyContent: 'center', }, @@ -62,8 +74,15 @@ const styles = StyleSheet.create({ }, userWrap: { width: '100%', - borderBottomColor: '#DFDFDF', - borderBottomWidth: 1, + height: 68, + backgroundColor: '#FFFFFF', + marginBottom: 1, + justifyContent: 'center', + }, + userMenu: { + marginLeft: 22, + fontSize: 16, + color: '#111111', }, }); diff --git a/src/screens/MyPoint.tsx b/src/screens/MyPoint.tsx new file mode 100644 index 0000000..56c0200 --- /dev/null +++ b/src/screens/MyPoint.tsx @@ -0,0 +1,23 @@ +import React, {useState} from 'react'; +import {View, StyleSheet, Text, TouchableOpacity} from 'react-native'; +import type {NativeStackScreenProps} from '@react-navigation/native-stack'; +import {MyStackParamList} from '../nav/MyNavigator'; +import {MyHeader} from '../components/MyHeader'; + +type Props = NativeStackScreenProps; + +export const MyPoint = ({navigation}: Props) => { + const goBack = () => { + navigation.goBack(); + }; + return ( + + + 내포인트 + + ); +}; + +const styles = StyleSheet.create({ + flex: {flex: 1}, +}); diff --git a/src/screens/MyReview.tsx b/src/screens/MyReview.tsx new file mode 100644 index 0000000..006ed2e --- /dev/null +++ b/src/screens/MyReview.tsx @@ -0,0 +1,23 @@ +import React, {useState} from 'react'; +import {View, StyleSheet, Text, TouchableOpacity} from 'react-native'; +import type {NativeStackScreenProps} from '@react-navigation/native-stack'; +import {MyStackParamList} from '../nav/MyNavigator'; +import {MyHeader} from '../components/MyHeader'; + +type Props = NativeStackScreenProps; + +export const MyReview = ({navigation}: Props) => { + const goBack = () => { + navigation.goBack(); + }; + return ( + + + MyReview + + ); +}; + +const styles = StyleSheet.create({ + flex: {flex: 1}, +});