diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index ee91978..ac6266e 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,28 +1,13 @@ -import React, { - Fragment, - useEffect, - useState, - useRef, - forwardRef, -} from 'react'; +import React, { Fragment, useState, useRef } from 'react'; -import { - SafeAreaView, - Text, - View, - StyleSheet, - Alert, - FlatList, -} from 'react-native'; +import { SafeAreaView, Text, View, Alert } from 'react-native'; import styled from 'styled-components/native'; -import { Filter14M } from '../styles/GlobalText'; -import { Tabs, MaterialTabBar } from 'react-native-collapsible-tab-view'; import { StackScreenProps, createStackNavigator, } from '@react-navigation/stack'; import { TabProps } from '../../App'; -import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'; +import { ScrollView } from 'react-native-gesture-handler'; import CustomHeader from '../common/CustomHeader'; import HomeTabView from '../components/Home/HomeMain'; @@ -45,20 +30,10 @@ import QuotationConfirm from '../components/Home/Quotation/QuotationConfirm'; import Rejection from '../components/Home/Quotation/Rejection'; import SentRejection from '../components/Home/Quotation/SentRejection'; import WriteReviewPage from '../components/Home/Market/WriteReviewPage'; -import { BottomBarProvider } from '../../contexts/BottomBarContext'; -import BottomSheet from '@gorhom/bottom-sheet/lib/typescript/components/bottomSheet'; import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'; import ComponentsTest from './ComponentsTest'; import { PURPLE } from '../styles/GlobalColor'; -import { ProfileSection } from '../components/Home/Market/MarketTabView'; -import ServicePage from '../components/Home/Market/ServicePage'; -import ScrollToTopButton from '../common/ScrollToTopButtonFlat'; -import ReviewPage from '../components/Home/Market/ReviewPage'; -import ScrollTopButton from '../common/ScrollTopButton'; -import Footer from '../common/Footer'; -import { BLACK, White } from '../styles/GlobalColor'; -import InfoPage from '../components/Home/Market/InfoPage'; -import OrderPage from '../components/Home/Order/OrderPage'; +// import OrderPage from '../components/Home/Order/OrderPage'; import OrderManagement from '../components/Home/Order/OrderManagement'; import ReformerMarket from '../components/Home/Market/ReformerMarket'; import Service from '../components/Home/Market/Service'; @@ -71,7 +46,7 @@ export type HomeStackParams = { ServiceDetailPage: { id?: number; }; - OrderPage: undefined; + // OrderPage: undefined; OrderManagement: undefined; GoodsDetailPage: undefined; QuotationForm: undefined; @@ -126,7 +101,7 @@ const HomeScreen = ({ - + {/* */} { - +const ProfileSection = ({ + nickname, + backgroundphoto, + profile_image, + editProfile, + introduce, +}: { + nickname: string; + backgroundphoto: any; + profile_image: PhotoType | any; + editProfile: any; + introduce: string; +}) => { return ( { }} - rightButton='Edit' - onPressRight={editProfile} /> + title="" + leftButton="CustomBack" + onPressLeft={() => {}} + rightButton="Edit" + onPressRight={editProfile} + /> - - {(profile_image === undefined) || (profile_image.uri == undefined) ? ( // 전자는 편집페이지에서 사진 삭제했을 경우, 후자는 가장 처음에 로딩될 경우 + + {profile_image === undefined || profile_image.uri == undefined ? ( // 전자는 편집페이지에서 사진 삭제했을 경우, 후자는 가장 처음에 로딩될 경우 + + ) : ( ) : () - } + /> + )} {nickname} - ) -} + ); +}; const MyPageMainScreen = ({ navigation, route }: MypageStackProps) => { const request = Request(); const { isLogin, setLogin } = useContext(LoginContext); const [userInfo, setUserInfo] = useState({ - nickname: route.params?.nickname || '이하늘', backgroundphoto: 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', - profile_image: route.params?.profile_image || 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', - introduce: route.params?.introduce || "나는야 업씨러 이하늘 환경을 사랑하지요 눈누난나" + nickname: route.params?.nickname || '이하늘', + backgroundphoto: + 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', + profile_image: + route.params?.profile_image || + 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', + introduce: + route.params?.introduce || + '나는야 업씨러 이하늘 환경을 사랑하지요 눈누난나', }); - // 나중에 프로필수정 로직 구현되고 나면, profilepho랑 backgroundphoto 할당하면 됨 + // 나중에 프로필수정 로직 구현되고 나면, profilepho랑 backgroundphoto 할당하면 됨 useEffect(() => { if (route.params?.userInfo) { @@ -116,9 +165,14 @@ const MyPageMainScreen = ({ navigation, route }: MypageStackProps) => { console.log('User data fetched successfully:', response.data); setUserInfo({ nickname: response.data.nickname, - backgroundphoto: 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', - profile_image: response.data.profile_image_url || 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', - introduce: response.data.introduce || '나는야 업씨러 이하늘 환경을 사랑하지요 눈누난나' + backgroundphoto: + 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', + profile_image: + response.data.profile_image_url || + 'https://image.made-in-china.com/2f0j00efRbSJMtHgqG/Denim-Bag-Youth-Fashion-Casual-Small-Mini-Square-Ladies-Shoulder-Bag-Women-Wash-Bags.webp', + introduce: + response.data.introduce || + '나는야 업씨러 이하늘 환경을 사랑하지요 눈누난나', }); return response.data; } else { @@ -130,7 +184,7 @@ const MyPageMainScreen = ({ navigation, route }: MypageStackProps) => { console.error('Error fetching user data:', error); return null; } - } + }; // useFocusEffect( // useCallback(() => { @@ -155,7 +209,7 @@ const MyPageMainScreen = ({ navigation, route }: MypageStackProps) => { const [routes] = useState([ { key: 'order', title: '주문' }, { key: 'lookbook', title: '룩북' }, - { key: 'like', title: '좋아요' } + { key: 'like', title: '좋아요' }, ]); const flatListRef = useRef(null); const scrollRef = useRef(null); @@ -164,23 +218,30 @@ const MyPageMainScreen = ({ navigation, route }: MypageStackProps) => { {/* 이 밑의 탭들은 더미 데이터 */} - navigation.navigate('FixMyPage', { userInfo })} introduce={userInfo.introduce} /> - {/*