From dc4823bedb2455190a67ceb161479cefee24d03c Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 01:14:56 +0900 Subject: [PATCH 1/8] Fix: fix swiper slide width --- src/components/MapZoomIn/RouteMapSlide/RouteMapSlide.module.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/MapZoomIn/RouteMapSlide/RouteMapSlide.module.scss b/src/components/MapZoomIn/RouteMapSlide/RouteMapSlide.module.scss index 8eca0dd8..c5fe7385 100644 --- a/src/components/MapZoomIn/RouteMapSlide/RouteMapSlide.module.scss +++ b/src/components/MapZoomIn/RouteMapSlide/RouteMapSlide.module.scss @@ -49,5 +49,6 @@ .swiperSlideItem { padding: 1rem 0; + min-width: 37.5rem; } } From da47c9a60bcda05a633deb5d448fc1dbc2fd173c Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 01:26:16 +0900 Subject: [PATCH 2/8] Fix: fix map pin not center --- .../Route/RouteTabPanel/RouteTabPanel.tsx | 4 ++-- .../AddPlaceFromVote/AddPlaceFromVote.tsx | 12 +++++------- src/pages/Trip/Trip.tsx | 18 +++++++++--------- src/recoil/spaces/trip.ts | 6 ++++++ src/types/route.ts | 1 + 5 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 src/recoil/spaces/trip.ts diff --git a/src/components/Route/RouteTabPanel/RouteTabPanel.tsx b/src/components/Route/RouteTabPanel/RouteTabPanel.tsx index fec50aba..36e5b905 100644 --- a/src/components/Route/RouteTabPanel/RouteTabPanel.tsx +++ b/src/components/Route/RouteTabPanel/RouteTabPanel.tsx @@ -24,7 +24,7 @@ import MapInTrip from '../MapInTrip/MapInTrip'; import {DateItem, Journey, MapInTripProps, PlaceList, SelectedPlace} from '@/types/route'; -function RouteTabPanel({mapRef, center, journeysData}: MapInTripProps) { +function RouteTabPanel({mapRef, center, level, journeysData}: MapInTripProps) { const navigate = useNavigate(); const {id} = useParams(); const [isEditMode, setIsEditMode] = useState(false); @@ -63,7 +63,7 @@ function RouteTabPanel({mapRef, center, journeysData}: MapInTripProps) { return (
- + diff --git a/src/pages/AddPlaceFromVote/AddPlaceFromVote.tsx b/src/pages/AddPlaceFromVote/AddPlaceFromVote.tsx index cb34517d..ecf439fc 100644 --- a/src/pages/AddPlaceFromVote/AddPlaceFromVote.tsx +++ b/src/pages/AddPlaceFromVote/AddPlaceFromVote.tsx @@ -1,8 +1,7 @@ import {Button} from '@chakra-ui/react'; -import {useEffect} from 'react'; import {MdOutlineReplay as ResetIcon} from 'react-icons/md'; import {useLocation, useNavigate} from 'react-router-dom'; -import {useRecoilState} from 'recoil'; +import {useRecoilState, useSetRecoilState} from 'recoil'; import styles from './AddPlaceFromVote.module.scss'; @@ -16,6 +15,7 @@ import {SelectedPlaces} from '@/components/Route/AddPlace/FromVote/VoteCard/Vote import BackIcon from '@/assets/back.svg?react'; import {selectedPlaceFromVoteState} from '@/recoil/spaces/selectPlace'; +import {activeTabIndexState} from '@/recoil/spaces/trip'; import {Vote} from '@/types/route'; @@ -23,16 +23,13 @@ function AddPlaceFromVote() { const goBack = useGoBack(); const {state} = useLocation(); const {id, journeyId, day} = state; - const {data: voteData, refetch} = useGetVoteListInfo(Number(id)); + const {data: voteData} = useGetVoteListInfo(Number(id)); const [selectedPlaces, setSelectedPlaces] = useRecoilState(selectedPlaceFromVoteState); const inProgressVotes = voteData?.data?.voteResponse?.filter((vote: Vote) => vote.voteStatus === '진행 중'); const completedVotes = voteData?.data?.voteResponse?.filter((vote: Vote) => vote.voteStatus === '결정 완료'); const postPlaces = usePostPlaces(); const navigate = useNavigate(); - - useEffect(() => { - refetch(); - }, []); + const setSelectedTabIndex = useSetRecoilState(activeTabIndexState); const addPlaces = async () => { await postPlaces.mutateAsync({ @@ -41,6 +38,7 @@ function AddPlaceFromVote() { placeIds: selectedPlaces.flatMap((place) => place.id), }); navigate(`/trip/${id}`, {state: {id: id}}); + setSelectedTabIndex(1); }; const resetSelected = () => { diff --git a/src/pages/Trip/Trip.tsx b/src/pages/Trip/Trip.tsx index e00b181c..962f50f5 100644 --- a/src/pages/Trip/Trip.tsx +++ b/src/pages/Trip/Trip.tsx @@ -14,7 +14,7 @@ import {AiOutlineBell as AlarmIcon} from 'react-icons/ai'; import {AiOutlineMenu as MenuIcon} from 'react-icons/ai'; import {FiPlus as PlusIcon} from 'react-icons/fi'; import {useNavigate, useParams} from 'react-router-dom'; -import {useSetRecoilState} from 'recoil'; +import {useRecoilState, useSetRecoilState} from 'recoil'; import styles from './Trip.module.scss'; @@ -29,6 +29,7 @@ import FriendList from '@/components/TripSpace/FriendList/FriendList'; import InviteFriends from '@/components/TripSpace/InviteFriends/InviteFriends'; import VoteTabPanel from '@/components/VoteTabPanel/VoteTabPanel'; +import {activeTabIndexState} from '@/recoil/spaces/trip'; import {journeyState} from '@/recoil/vote/addToJourney'; import {checkDDay} from '@/utils/checkDday'; import {setSpaceDate} from '@/utils/formatDate'; @@ -39,7 +40,7 @@ import {Member} from '@/types/sidebar'; function Trip() { const news = localStorage.getItem('news'); - const [selectedTabIndex, setSelectedTabIndex] = useState(0); + const [selectedTabIndex, setSelectedTabIndex] = useRecoilState(activeTabIndexState); const {isOpen: isBottomSlideOpen, onOpen: onBottomSlideOpen, onClose: onBottomSlideClose} = useDisclosure(); const {isOpen: isSlideBarOpen, onOpen: onSlideBarOpen, onClose: onSlideBarClose} = useDisclosure(); const {isOpen: isInviteOpen, onOpen: onInviteOpen, onClose: onInviteClose} = useDisclosure(); @@ -50,6 +51,7 @@ function Trip() { const {data: journeysData} = useGetJourneys(Number(id)); const mapRef = useRef(null); const [center, setCenter] = useState(getMapCenter(journeysData?.data)); + const [level, setLevel] = useState(1); const navigate = useNavigate(); const users = spaceData?.data?.members; const SetJourneyAtom = useSetRecoilState(journeyState(Number(id))); @@ -70,12 +72,10 @@ function Trip() { useEffect(() => { const map = mapRef.current; - - if (map) { - map.relayout(); - setCenter(getMapCenter(journeysData.data)); - } - }, [selectedTabIndex, journeysData]); + map?.relayout(); + setCenter(getMapCenter(journeysData?.data)); + setLevel(1); + }, [selectedTabIndex]); return ( <> @@ -168,7 +168,7 @@ function Trip() { - + diff --git a/src/recoil/spaces/trip.ts b/src/recoil/spaces/trip.ts new file mode 100644 index 00000000..33b17003 --- /dev/null +++ b/src/recoil/spaces/trip.ts @@ -0,0 +1,6 @@ +import {atom} from 'recoil'; + +export const activeTabIndexState = atom({ + key: 'activeTabIndexState', + default: 0, +}); diff --git a/src/types/route.ts b/src/types/route.ts index dadbda34..5551c1fc 100644 --- a/src/types/route.ts +++ b/src/types/route.ts @@ -92,6 +92,7 @@ export interface LatLng { export interface MapInTripProps { mapRef: React.RefObject; center: LatLng; + level: number; journeysData: Journeys; } From 11e4d902ba923363ef26b55f27835d5c26c00dd5 Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 03:26:51 +0900 Subject: [PATCH 3/8] Fix: fix branch processing in trip page --- src/api/spaces.ts | 5 ++++- src/pages/Trip/CheckTrip.tsx | 26 ++++++++++++++++---------- src/pages/Trip/Trip.tsx | 13 +++++-------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/api/spaces.ts b/src/api/spaces.ts index 03b2e18a..ee05cd71 100644 --- a/src/api/spaces.ts +++ b/src/api/spaces.ts @@ -56,7 +56,10 @@ export const getSpace = async (spaceId: number) => { const response = await axios.get(`/api/spaces/${spaceId}`, {withCredentials: true}); return response.data; } catch (error) { - console.log(error); + if (axios.isAxiosError(error)) { + console.log(error); + return error.response; + } } }; diff --git a/src/pages/Trip/CheckTrip.tsx b/src/pages/Trip/CheckTrip.tsx index 0f283f37..fdc764a7 100644 --- a/src/pages/Trip/CheckTrip.tsx +++ b/src/pages/Trip/CheckTrip.tsx @@ -1,4 +1,5 @@ import {Tab, TabIndicator, TabList, TabPanel, TabPanels, Tabs} from '@chakra-ui/react'; +import {useEffect} from 'react'; import {AiOutlineBell as AlarmIcon} from 'react-icons/ai'; import {AiOutlineMenu as MenuIcon} from 'react-icons/ai'; import {FiPlus as PlusIcon} from 'react-icons/fi'; @@ -13,6 +14,7 @@ import useGoLogin from '@/hooks/useGoLogin'; import AlertModal from '@/components/AlertModal/AlertModal'; +import {activeTabIndexState} from '@/recoil/spaces/trip'; import {isModalOpenState} from '@/recoil/vote/alertModal'; function CheckTrip() { @@ -21,17 +23,21 @@ function CheckTrip() { const setIsModal = useSetRecoilState(isModalOpenState); const {mutate} = usePostSpace(); const navigate = useNavigate(); + const setSelectedTabIndex = useSetRecoilState(activeTabIndexState); - if (recentSpaceData?.status === 403 || recentSpaceData?.status === 401) { - // 비로그인 유저 - goLogin(); - } else if (recentSpaceData?.responseCode === 404) { - // 유효한 여행 스페이스 없는 유저 - setIsModal(true); - } else if (recentSpaceData?.data?.id) { - // 최근 방문 스페이스 있는 유저 - navigate(`/trip/${recentSpaceData.data.id}`, {state: {id: recentSpaceData.data.id}}); - } + useEffect(() => { + if (recentSpaceData?.status === 403 || recentSpaceData?.status === 401) { + // 비로그인 유저 + goLogin(); + } else if (recentSpaceData?.responseCode === 404) { + // 유효한 여행 스페이스 없는 유저 + setIsModal(true); + } else if (recentSpaceData?.data?.id) { + // 최근 방문 스페이스 있는 유저 + navigate(`/trip/${recentSpaceData?.data?.id}`, {state: {id: recentSpaceData?.data?.id}}); + setSelectedTabIndex(0); + } + }, [recentSpaceData]); const makeNewSpace = () => { setIsModal(false); diff --git a/src/pages/Trip/Trip.tsx b/src/pages/Trip/Trip.tsx index 962f50f5..c3d07b3b 100644 --- a/src/pages/Trip/Trip.tsx +++ b/src/pages/Trip/Trip.tsx @@ -57,17 +57,12 @@ function Trip() { const SetJourneyAtom = useSetRecoilState(journeyState(Number(id))); if (journeysData) { - SetJourneyAtom(journeysData.data); + SetJourneyAtom(journeysData?.data); } - if (!spaceData?.data) { + if (spaceData?.status === 403) { console.log('로그인 안 했음'); - navigate('/trip'); - } - - if (spaceData?.data) { - console.log(spaceData?.data); - console.log(journeysData?.data); + navigate('/auth/login'); } useEffect(() => { @@ -75,6 +70,8 @@ function Trip() { map?.relayout(); setCenter(getMapCenter(journeysData?.data)); setLevel(1); + + console.log(selectedTabIndex); }, [selectedTabIndex]); return ( From f61ec35a5357950aa7d860e846ec2ef68f3f02bb Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 03:27:39 +0900 Subject: [PATCH 4/8] Fix: add recoil state for map relayout --- .../AddToJourney/AddToJourney.tsx | 9 ++++++++- src/pages/RegionSearch/RegionSearch.tsx | 20 +++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/components/Vote/VoteBottomSlideContent/AddToJourney/AddToJourney.tsx b/src/components/Vote/VoteBottomSlideContent/AddToJourney/AddToJourney.tsx index 1819200a..eb0725d8 100644 --- a/src/components/Vote/VoteBottomSlideContent/AddToJourney/AddToJourney.tsx +++ b/src/components/Vote/VoteBottomSlideContent/AddToJourney/AddToJourney.tsx @@ -10,6 +10,7 @@ import {usePostPlaces} from '@/hooks/Spaces/space'; import CustomToast from '@/components/CustomToast/CustomToast'; +import {activeTabIndexState} from '@/recoil/spaces/trip'; import {journeyState} from '@/recoil/vote/addToJourney'; import {isBottomSlideOpenState} from '@/recoil/vote/bottomSlide'; const AddToJourney = ({placeId}: {placeId: number}) => { @@ -23,6 +24,7 @@ const AddToJourney = ({placeId}: {placeId: number}) => { const {mutateAsync: addToJourneyMutateAsync} = usePostPlaces(); const [journeyId, SetJourneyId] = useState(journeyAtom.journeys?.[1]?.journeyId); const showToast = CustomToast(); + const setSelectedTabIndex = useSetRecoilState(activeTabIndexState); const handleSelect = (index: number) => { const updatedSelectedDays = [...selectedDays]; @@ -34,12 +36,17 @@ const AddToJourney = ({placeId}: {placeId: number}) => { SetJourneyId(newJourneyId); }; + const handleGoBackToJourney = () => { + navigate(`/trip/${spaceId}`); + setSelectedTabIndex(1); + }; + //중복 선택 불가 추가 const handleAddToJourney = async () => { const res = await addToJourneyMutateAsync({spaceId, journeyId, placeIds: [placeId]}); setIsBTOpen(false); console.log('일정추가 res', res); - showToast('일정에 추가가 완료되었습니다.', true, '바로가기', () => navigate(`/trip/${spaceId}`)); + showToast('일정에 추가가 완료되었습니다.', true, '바로가기', handleGoBackToJourney); }; return ( diff --git a/src/pages/RegionSearch/RegionSearch.tsx b/src/pages/RegionSearch/RegionSearch.tsx index e6411b8c..a18ae74d 100644 --- a/src/pages/RegionSearch/RegionSearch.tsx +++ b/src/pages/RegionSearch/RegionSearch.tsx @@ -28,7 +28,7 @@ function RegionSearch() { const [selectedRegions, setSelectedRegions] = useState(prevRegion ? prevRegion : []); const [filteredRegions, setFilteredRegions] = useState(regions); - if (spaceData.responseCode === 404) { + if (spaceData?.responseCode === 404) { setSelectedRegions([]); } @@ -45,10 +45,10 @@ function RegionSearch() { }; const handleRegionSelect = (regionName: string) => { - if (selectedRegions.includes(regionName)) { - setSelectedRegions((prevSelectedRegions) => prevSelectedRegions.filter((name) => name !== regionName)); + if (selectedRegions?.includes(regionName)) { + setSelectedRegions((prevSelectedRegions) => prevSelectedRegions?.filter((name) => name !== regionName)); } else { - if (selectedRegions.length < 4) { + if (selectedRegions?.length < 4) { setSelectedRegions((prevSelectedRegions) => [...prevSelectedRegions, regionName]); } else { showToast('최대 4개 도시까지 선택 가능합니다.', false, ''); @@ -73,9 +73,9 @@ function RegionSearch() { />
- {filteredRegions.length ? ( + {filteredRegions?.length ? ( <> - {filteredRegions.map((region) => ( + {filteredRegions?.map((region) => ( )}
-
+
- {selectedRegions.map((region) => ( + {selectedRegions?.map((region) => ( ))}
-
From b38775b3d6e6264b34ccd9ba00f290a5fe64be2d Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 04:24:44 +0900 Subject: [PATCH 5/8] Feat: add post search place hook --- src/api/spaces.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/api/spaces.ts b/src/api/spaces.ts index ee05cd71..becf294b 100644 --- a/src/api/spaces.ts +++ b/src/api/spaces.ts @@ -5,6 +5,7 @@ import { journeyParams, journeyPutParams, PlaceParams, + SearchPlaceParams, SpaceDateParams, SpaceRegionParams, } from '@/types/route'; @@ -101,6 +102,21 @@ export const postPlaces = async ({spaceId, journeyId, placeIds}: PlaceParams) => } }; +// [POST] 장소 검색 일정 추가 +export const postSearchPlaces = async ({spaceId, journeyId, places}: SearchPlaceParams) => { + try { + const response = await axios.post( + `/api/spaces/${spaceId}/places/search`, + {journeyId: journeyId, places: places}, + {withCredentials: true}, + ); + console.log('[SUCCESS]', response); + return response; + } catch (error) { + console.error(error); + } +}; + // [PUT] 일정 수정 export const putPlaces = async ({spaceId, places}: journeyPutParams) => { try { From a8173233732b7b5cad7f5873d46850052a0a6689 Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 04:24:55 +0900 Subject: [PATCH 6/8] Feat: add post search place hook --- src/hooks/Spaces/space.ts | 19 +++++++++++++++++-- src/types/route.ts | 9 +++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/hooks/Spaces/space.ts b/src/hooks/Spaces/space.ts index 3c5f218f..bca4b56c 100644 --- a/src/hooks/Spaces/space.ts +++ b/src/hooks/Spaces/space.ts @@ -1,4 +1,4 @@ -import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'; +import {useMutation, useQuery, useQueryClient, useSuspenseQuery} from '@tanstack/react-query'; import { deletePlaces, @@ -7,6 +7,7 @@ import { getRegions, getSpace, postPlaces, + postSearchPlaces, putDates, putExitSpace, putPlaces, @@ -15,7 +16,7 @@ import { // [GET] 지역 리스트 조회 export const useGetRegions = () => { - return useQuery({ + return useSuspenseQuery({ queryKey: ['spaces', 'city'], queryFn: () => getRegions(), }); @@ -58,6 +59,20 @@ export const usePostPlaces = () => { }); }; +// [POST] 일정 추가 +export const usePostSearchPlaces = () => { + const queryClient = useQueryClient(); + return useMutation({ + mutationFn: postSearchPlaces, + onSuccess: () => { + queryClient.invalidateQueries({queryKey: ['spaces']}); + queryClient.invalidateQueries({queryKey: ['journey']}); + queryClient.invalidateQueries({queryKey: ['places']}); + queryClient.invalidateQueries({queryKey: ['search']}); + }, + }); +}; + // [PUT] 일정 수정 export const usePutPlaces = () => { const queryClient = useQueryClient(); diff --git a/src/types/route.ts b/src/types/route.ts index 5551c1fc..165fbc02 100644 --- a/src/types/route.ts +++ b/src/types/route.ts @@ -212,6 +212,15 @@ export interface ExitSpaceParams { spaceId: number; } +export interface SearchPlaceParams { + spaceId: number; + journeyId: number; + places: { + placeId: number; + contentTypeId: number; + }[]; +} + export interface PlaceParams { spaceId: number; journeyId: number; From d99b3d9bba57b6f0bf46a4f4a163bfd689484c63 Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 04:54:04 +0900 Subject: [PATCH 7/8] Fix: add reload after edit places --- src/components/Route/DayMove/DayMove.tsx | 21 +++++++++---------- .../DeletePlacesModal/DeletePlacesModal.tsx | 4 +++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/Route/DayMove/DayMove.tsx b/src/components/Route/DayMove/DayMove.tsx index b5d02bb6..8f6f7d5f 100644 --- a/src/components/Route/DayMove/DayMove.tsx +++ b/src/components/Route/DayMove/DayMove.tsx @@ -1,6 +1,7 @@ import {useState} from 'react'; import {RiCheckboxCircleFill as SelectedIcon} from 'react-icons/ri'; -import {useParams} from 'react-router-dom'; +import {useNavigate, useParams} from 'react-router-dom'; +import {useSetRecoilState} from 'recoil'; import styles from './DayMove.module.scss'; @@ -8,6 +9,8 @@ import {useDeletePlaces, usePostPlaces} from '@/hooks/Spaces/space'; import {transformSelectedPlaces} from '@/components/Route/RouteTabPanel/formatJourneyData'; +import {activeTabIndexState} from '@/recoil/spaces/trip'; + import {DayMoveProps} from '@/types/route'; function DayMove({journeysData, selectedPlaces, onClose, setIsEditMode}: DayMoveProps) { @@ -16,19 +19,15 @@ function DayMove({journeysData, selectedPlaces, onClose, setIsEditMode}: DayMove const {id} = useParams(); const deletePlaces = useDeletePlaces(); const postPlaces = usePostPlaces(); + const navigate = useNavigate(); + const setSelectedTabIndex = useSetRecoilState(activeTabIndexState); const handleSelect = async (index: number) => { const updatedSelectedDays = [...selectedDays]; updatedSelectedDays[index] = !updatedSelectedDays[index]; setSelectedDays(updatedSelectedDays); - // TODO: 선택된 장소 카드 선택한 날짜 동선으로 이동 const journeysId = journeysData?.journeys?.[index]?.journeyId; - console.log('지우겠다', transformSelectedPlaces(selectedPlaces)); - console.log('추가하겠다.', { - journeyId: journeysId, - placeIds: selectedPlaces.flatMap((place) => place.placeId), - }); await deletePlaces.mutateAsync({spaceId: Number(id), places: transformSelectedPlaces(selectedPlaces)}); await postPlaces.mutateAsync({ @@ -37,10 +36,10 @@ function DayMove({journeysData, selectedPlaces, onClose, setIsEditMode}: DayMove placeIds: selectedPlaces.flatMap((place) => place.placeId), }); - setTimeout(() => { - onClose(); - setIsEditMode(false); - }, 300); + // FIXME: 페이지에 잔류하면서 보여지는 데이터 갱신 + window.location.reload(); + onClose(); + setIsEditMode(false); }; return ( diff --git a/src/components/Route/DeletePlacesModal/DeletePlacesModal.tsx b/src/components/Route/DeletePlacesModal/DeletePlacesModal.tsx index 07bc706a..f6b94955 100644 --- a/src/components/Route/DeletePlacesModal/DeletePlacesModal.tsx +++ b/src/components/Route/DeletePlacesModal/DeletePlacesModal.tsx @@ -11,9 +11,11 @@ function DeletePlacesModal({isOpen, onClose, setIsEditMode, placeList}: DeletePl const deleteJourneys = async () => { await deletePlaces.mutateAsync({spaceId: Number(id), places: placeList}); + + // FIXME: 페이지에 잔류하면서 보여지는 데이터 갱신 + window.location.reload(); onClose(); setIsEditMode(false); - // FIXME: 삭제 후 리스트 자동 갱신 안 됨 }; return ( From 219387ad2ecb9d6b4622e955b7d25be07cac80f3 Mon Sep 17 00:00:00 2001 From: JSH99 Date: Mon, 29 Jan 2024 04:59:35 +0900 Subject: [PATCH 8/8] Fix: fix build error --- src/components/Route/DayMove/DayMove.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/Route/DayMove/DayMove.tsx b/src/components/Route/DayMove/DayMove.tsx index 8f6f7d5f..b045a333 100644 --- a/src/components/Route/DayMove/DayMove.tsx +++ b/src/components/Route/DayMove/DayMove.tsx @@ -1,7 +1,6 @@ import {useState} from 'react'; import {RiCheckboxCircleFill as SelectedIcon} from 'react-icons/ri'; -import {useNavigate, useParams} from 'react-router-dom'; -import {useSetRecoilState} from 'recoil'; +import {useParams} from 'react-router-dom'; import styles from './DayMove.module.scss'; @@ -9,8 +8,6 @@ import {useDeletePlaces, usePostPlaces} from '@/hooks/Spaces/space'; import {transformSelectedPlaces} from '@/components/Route/RouteTabPanel/formatJourneyData'; -import {activeTabIndexState} from '@/recoil/spaces/trip'; - import {DayMoveProps} from '@/types/route'; function DayMove({journeysData, selectedPlaces, onClose, setIsEditMode}: DayMoveProps) { @@ -19,8 +16,6 @@ function DayMove({journeysData, selectedPlaces, onClose, setIsEditMode}: DayMove const {id} = useParams(); const deletePlaces = useDeletePlaces(); const postPlaces = usePostPlaces(); - const navigate = useNavigate(); - const setSelectedTabIndex = useSetRecoilState(activeTabIndexState); const handleSelect = async (index: number) => { const updatedSelectedDays = [...selectedDays];