From f7589df420bb05be9ce9c3dced163957e56b2cef Mon Sep 17 00:00:00 2001 From: khw2002 Date: Mon, 30 Sep 2024 16:40:02 +0900 Subject: [PATCH 1/5] #115 feat : add MarketTabView UI --- src/components/Home/Market/MarketTabView.tsx | 247 ++++++++++++------- 1 file changed, 159 insertions(+), 88 deletions(-) diff --git a/src/components/Home/Market/MarketTabView.tsx b/src/components/Home/Market/MarketTabView.tsx index c582330..a43cf61 100644 --- a/src/components/Home/Market/MarketTabView.tsx +++ b/src/components/Home/Market/MarketTabView.tsx @@ -1,87 +1,124 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { SafeAreaView, ScrollView, View, FlatList, Text, TouchableOpacity, Image, ImageBackground } from 'react-native'; -import styled from 'styled-components/native'; +import React, { useRef, useState } from 'react'; +import { + SafeAreaView, + ScrollView, + View, + FlatList, + Text, + TouchableOpacity, + Image, + ImageBackground, + StyleSheet, +} from 'react-native'; import { Tabs, MaterialTabBar } from 'react-native-collapsible-tab-view'; -import { getStatusBarHeight } from 'react-native-safearea-height'; -import { Title20B, Body14R, Caption11M } from '../../../styles/GlobalText.tsx'; -import { BLACK, BLACK2 } from '../../../styles/GlobalColor.tsx'; +import { Caption11M } from '../../../styles/GlobalText.tsx'; +import { BLACK, BLACK2, PURPLE } from '../../../styles/GlobalColor.tsx'; +import StarIcon from '../../../assets/common/Star.svg'; import { StackScreenProps } from '@react-navigation/stack'; import { HomeStackParams } from '../../../pages/Home'; import InfoPage from './InfoPage.tsx'; -import ProductPage from './ServicePage.tsx'; import ReviewPage from './ReviewPage.tsx'; -import Hashtag from '../../../common/Hashtag.tsx'; import Footer from '../../../common/Footer.tsx'; import Arrow from '../../../assets/common/Arrow.svg'; -import Pencil from '../../../assets/common/Pencil.svg'; import ServicePage from './ServicePage.tsx'; -import { CustomBackButton } from '../components/CustomBackButton.tsx'; import DetailScreenHeader from '../components/DetailScreenHeader.tsx'; -import { useBottomBar } from '../../../../contexts/BottomBarContext.tsx'; -import TextToggle from '../../../common/TextToggle.tsx'; import ScrollToTopButton from '../../../common/ScrollToTopButtonFlat.tsx'; import ScrollTopButton from '../../../common/ScrollTopButton.tsx'; -import ReviewComment from '../components/ReviewComment.tsx'; export const ProfileSection = ({ navigation }: { navigation: any }) => { + const marketName: string = '이하늘의 마켓'; + const selfIntroduce: string = + '안녕하세요 리폼러 이하늘입니다! 저는 업씨대학교 패션디자인학과에 수석입학했고요 짱짱 천재에요'; + const rate: number = 4.5; // 평점 + const reviewNumber: number = 100; // 후기 개수 - const filter = [ - { id: 1, tag: '스포티' }, { id: 2, tag: '영캐주얼' }, { id: 3, tag: '깔끔' } - ] - const tagList = filter.map(item => item.tag); - const markerName = '이하늘의 마켓'; - const selfIntroduce = '안녕하세요 리폼러 이하늘입니다! 저는 업씨대학교 패션디자인학과에 수석입학했고요 짱짱 천재에요' return ( - { }} - rightButton='Edit' - onPressRight={() => { }} /> - - - - - {markerName} + - {/* 이 밑에거 지우면 이상하게 에러남... 그냥 냅둬도 되는 거라 무시하셔도 됩니다. */} - index.toString()} - renderItem={({ item }) => { - return ( - - ) - }} - /> - ) -} + ); +}; -const MarketTabView = ({ navigation, route }: StackScreenProps) => { +const ProfileHeader = ({ + marketName, + rate, + reviewNumber, +}: { + marketName: string; + rate: number; + reviewNumber: number; +}) => { + return ( + <> + {}} + rightButton="Edit" + onPressRight={() => {}} + /> + + + + + {marketName} + + + {rate} + ({reviewNumber}) + + {/* TODO: click event 걸기 */} + + + ); +}; +const MarketTabView = ({ + navigation, + route, +}: StackScreenProps) => { const [routes] = useState([ { key: 'info', title: '정보' }, { key: 'service', title: '서비스' }, - { key: 'review', title: '리뷰' } + { key: 'review', title: '리뷰' }, ]); const flatListRef = useRef(null); const scrollRef = useRef(null); @@ -93,14 +130,14 @@ const MarketTabView = ({ navigation, route }: StackScreenProps ( - )} - > - {routes.map(route => - ( - {route.key === 'info' && } - {route.key === 'service' && - - - - - } - {route.key === 'review' && - - - - } - ) - )} + )}> + {routes.map(route => ( + + {route.key === 'info' && } + {route.key === 'service' && ( + + + + + )} + {route.key === 'review' && ( + + + + + )} + + ))}