From bb125f71bb911dad068c4b49bc8f0bb535d760f4 Mon Sep 17 00:00:00 2001 From: aaminha Date: Thu, 23 Nov 2023 21:19:20 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=B6=94=EC=B2=9C=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=EC=9D=B4=20=EC=97=86=EC=9C=BC=EB=A9=B4=20=EC=95=88=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/DetailProgram/RecommendAccom.tsx | 17 ++------- src/pages/DetailProgram/RecommendSpot.tsx | 17 ++------- src/pages/DetailProgram/index.tsx | 40 ++++++++-------------- 3 files changed, 18 insertions(+), 56 deletions(-) diff --git a/src/pages/DetailProgram/RecommendAccom.tsx b/src/pages/DetailProgram/RecommendAccom.tsx index 5eac141..e5984e6 100644 --- a/src/pages/DetailProgram/RecommendAccom.tsx +++ b/src/pages/DetailProgram/RecommendAccom.tsx @@ -1,4 +1,3 @@ -import Loading from '@/components/Loading/Loading'; import RecommendCard from '@/components/RecommendCard/RecommendCard'; import { H1 } from '@/style/fonts/StyledFonts'; import { RecommendDataType } from '@/types'; @@ -6,20 +5,13 @@ import styled from 'styled-components'; interface RecommendAccomProps { resultList: RecommendDataType[]; - isLoading: boolean; } -const RecommendAccom = ({ resultList, isLoading }: RecommendAccomProps) => { +const RecommendAccom = ({ resultList }: RecommendAccomProps) => { return (

숙소 추천

- {isLoading ? ( - - - - ) : ( - - )} +
); }; @@ -34,8 +26,3 @@ const Container = styled.div` margin-bottom: 193px; text-align: left; `; - -const LoadingWrapper = styled.div` - background-color: red; - position: relative; -`; diff --git a/src/pages/DetailProgram/RecommendSpot.tsx b/src/pages/DetailProgram/RecommendSpot.tsx index 15eb491..54035c7 100644 --- a/src/pages/DetailProgram/RecommendSpot.tsx +++ b/src/pages/DetailProgram/RecommendSpot.tsx @@ -1,4 +1,3 @@ -import Loading from '@/components/Loading/Loading'; import RecommendCard from '@/components/RecommendCard/RecommendCard'; import { H1 } from '@/style/fonts/StyledFonts'; import { RecommendDataType } from '@/types'; @@ -6,20 +5,13 @@ import styled from 'styled-components'; interface RecommendSpotProps { resultList: RecommendDataType[]; - isLoading: boolean; } -const RecommendSpot = ({ resultList, isLoading }: RecommendSpotProps) => { +const RecommendSpot = ({ resultList }: RecommendSpotProps) => { return (

여행지 추천

- {isLoading ? ( - - - - ) : ( - - )} +
); }; @@ -34,8 +26,3 @@ const Container = styled.div` padding-bottom: 16px; text-align: left; `; - -const LoadingWrapper = styled.div` - background-color: red; - position: relative; -`; diff --git a/src/pages/DetailProgram/index.tsx b/src/pages/DetailProgram/index.tsx index 19f5726..abbd662 100644 --- a/src/pages/DetailProgram/index.tsx +++ b/src/pages/DetailProgram/index.tsx @@ -32,16 +32,14 @@ const DetailProgram = () => { programId, writerVersion, }); - const { data: recommendSpotList, isLoading: spotListLoading } = - useGetRegionTour({ - programId, - writerVersion, - }); - const { data: recommendAccomList, isLoading: accomListLoading } = - useGetRegionLodgment({ - programId, - writerVersion, - }); + const { data: recommendSpotList } = useGetRegionTour({ + programId, + writerVersion, + }); + const { data: recommendAccomList } = useGetRegionLodgment({ + programId, + writerVersion, + }); const userInfo = useRecoilValue(UserAtom); const navigate = useNavigate(); @@ -96,22 +94,12 @@ const DetailProgram = () => {
- 0 - ? recommendSpotList - : [] - } - isLoading={spotListLoading} - /> - 0 - ? recommendAccomList - : [] - } - isLoading={accomListLoading} - /> + {recommendSpotList && recommendSpotList.length > 0 && ( + + )} + {recommendAccomList && recommendAccomList.length > 0 && ( + + )}