From 5fa250bf2b9ab76a5a74dcc5a7382e11dd3ed009 Mon Sep 17 00:00:00 2001 From: yyeonzu Date: Sun, 26 Jan 2025 23:41:40 +0900 Subject: [PATCH] =?UTF-8?q?:recycle:=20=ED=83=80=EC=9E=85,=20=EA=B3=B5?= =?UTF-8?q?=ED=86=B5=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81=20(#274)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/climbing/ReviewBoard.tsx | 5 +---- src/pages/climbing/ClimbingTerminatePage.tsx | 14 +++++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/climbing/ReviewBoard.tsx b/src/components/climbing/ReviewBoard.tsx index 3638da62..4cc007cf 100644 --- a/src/components/climbing/ReviewBoard.tsx +++ b/src/components/climbing/ReviewBoard.tsx @@ -6,7 +6,6 @@ import AddReactionIcon from '@mui/icons-material/AddReaction'; import useBottomsheet from '@src/hooks/useBottomsheet'; import EmojiList from '@src/components/climbing/EmojiList'; import { useQuery } from '@tanstack/react-query'; -import { ClimbingResponse } from '@src/types/apis/climbing.d'; import { getClimbingReview } from '@src/apis/climbing'; import useLoaderData from '@src/hooks/useRoaderData'; import Chip from '@src/components/common/Tag'; @@ -48,7 +47,7 @@ import { ReactComponent as IcnStar } from '@src/assets/icons/md_star.svg'; const ReviewBoard = () => { const { openBottomsheet } = useBottomsheet(); const { id: climbingId } = useLoaderData<{ id: number }>(); - const { data, isLoading, isError } = useQuery({ + const { data, isLoading, isError } = useQuery({ queryKey: ['climbingReview', climbingId], queryFn: () => getClimbingReview(climbingId), }); @@ -63,8 +62,6 @@ const ReviewBoard = () => { return
No data available
; } - console.log(data); - /* eslint-disable */ return ( {data.hasShared && } diff --git a/src/pages/climbing/ClimbingTerminatePage.tsx b/src/pages/climbing/ClimbingTerminatePage.tsx index fa084ccc..9f7c63a1 100644 --- a/src/pages/climbing/ClimbingTerminatePage.tsx +++ b/src/pages/climbing/ClimbingTerminatePage.tsx @@ -1,23 +1,31 @@ import ClimbingBoard from '@src/components/climbing/ClimbingBoard'; import Header from '@src/components/common/Header'; -import SegmentedButton from '@src/components/climbing/SegmentedButton'; import { useState } from 'react'; import styled from 'styled-components'; import ReviewBoard from '@src/components/climbing/ReviewBoard'; +import SegmentedButton from '@src/components/common/SegmentedButton'; export type ViewType = 'climbing' | 'review'; const ClimbingTerminatePage = ({ name: headerText }: { name: string }) => { - const [selectedView, setSelectedView] = useState('climbing'); + const [selectedView, setSelectedView] = useState('review'); const handleSegmentChange = (value: ViewType) => { setSelectedView(value); }; + const SEGMENTED_BUTTON_CONFIG: { value: ViewType; label: string }[] = [ + { value: 'climbing', label: '클라이밍' }, + { value: 'review', label: '감상평' }, + ]; return ( <>
- + {selectedView === 'climbing' && } {selectedView === 'review' && }