diff --git a/frontend/src/api/auth/index.ts b/frontend/src/api/auth/index.ts index ce672438..55281f00 100644 --- a/frontend/src/api/auth/index.ts +++ b/frontend/src/api/auth/index.ts @@ -1,5 +1,6 @@ +import { axiosInstance } from '@/api/axiosInstance'; + import { END_POINTS } from '@/constants/api'; -import { axiosInstance } from '../axiosInstance'; import { User } from '@/types'; type LogInResponse = { diff --git a/frontend/src/api/axiosInstance.ts b/frontend/src/api/axiosInstance.ts index 9f3b4c49..05caea0f 100644 --- a/frontend/src/api/axiosInstance.ts +++ b/frontend/src/api/axiosInstance.ts @@ -1,6 +1,7 @@ import axios from 'axios'; import { AXIOS_BASE_URL, NETWORK } from '@/constants/api'; + import { checkAndSetToken, handleAPIError, diff --git a/frontend/src/api/course/index.ts b/frontend/src/api/course/index.ts index 1e84a3d2..bc89d444 100644 --- a/frontend/src/api/course/index.ts +++ b/frontend/src/api/course/index.ts @@ -1,5 +1,6 @@ +import { axiosInstance } from '@/api/axiosInstance'; + import { BaseMap, Course, CourseList } from '@/types'; -import { axiosInstance } from '../axiosInstance'; import { END_POINTS } from '@/constants/api'; type CourseResponse = { diff --git a/frontend/src/api/image/index.ts b/frontend/src/api/image/index.ts index ac60c96f..fe7af39d 100644 --- a/frontend/src/api/image/index.ts +++ b/frontend/src/api/image/index.ts @@ -1,7 +1,8 @@ -import { axiosInstance } from '../axiosInstance'; -import { PreSignedURLResponse } from '../../types'; +import { axiosInstance } from '@/api/axiosInstance'; + +import { PreSignedURLResponse } from '@/types'; import { END_POINTS, IMAGE_EXTENSIONS } from '@/constants/api'; -import { IMAGE_HEIGHT, IMAGE_WIDTH, THREE_MB } from '../../constants/api'; +import { IMAGE_HEIGHT, IMAGE_WIDTH, THREE_MB } from '@/constants/api'; const generatePreSignedPost = async (dirName: string, extension: string) => { const { data } = await axiosInstance.post( diff --git a/frontend/src/api/interceptors.ts b/frontend/src/api/interceptors.ts index 7c73b328..c108fe44 100644 --- a/frontend/src/api/interceptors.ts +++ b/frontend/src/api/interceptors.ts @@ -1,6 +1,8 @@ import { AxiosError, InternalAxiosRequestConfig } from 'axios'; + import { postTokenRefresh } from './auth'; import { axiosInstance } from './axiosInstance'; + import { USER_ERROR_MESSAGE } from '@/constants/api'; import { CustomError } from './CustomError'; @@ -50,7 +52,6 @@ export const handleTokenError = async ( } if (data.code === 'E500') { - console.log('유효하지 않은 토큰입니다.'); localStorage.removeItem('ACCESS_TOKEN_KEY'); throw new Error('로그인이 필요합니다.'); } diff --git a/frontend/src/api/map/index.ts b/frontend/src/api/map/index.ts index 93b333d3..0c63867d 100644 --- a/frontend/src/api/map/index.ts +++ b/frontend/src/api/map/index.ts @@ -1,5 +1,6 @@ +import { axiosInstance } from '@/api/axiosInstance'; + import { BaseMap, MapList, Map } from '@/types'; -import { axiosInstance } from '../axiosInstance'; import { END_POINTS } from '@/constants/api'; type MapResponse = { @@ -61,7 +62,6 @@ export const editMapInfo = async ({ thumbnailUrl: string; mapId: number; }) => { - console.log(thumbnailUrl, 'thumbnailUrl API'); const { data } = await axiosInstance.patch( END_POINTS.EDIT_MAP_INFO(mapId), { diff --git a/frontend/src/api/place/index.ts b/frontend/src/api/place/index.ts index a90fe9f5..98fce713 100644 --- a/frontend/src/api/place/index.ts +++ b/frontend/src/api/place/index.ts @@ -1,6 +1,7 @@ +import { axiosInstance } from '@/api/axiosInstance'; + import { END_POINTS } from '@/constants/api'; import { CoursePlace, CustomPlace, Place, PlaceWithOrder } from '@/types'; -import { axiosInstance } from '../axiosInstance'; export const getPlace = async (queryString: string, pageParam: number) => { const { data } = await axiosInstance.get(END_POINTS.PLACE, { diff --git a/frontend/src/components/Authorize.tsx b/frontend/src/components/Authorize.tsx index f5d26321..3ce393a9 100644 --- a/frontend/src/components/Authorize.tsx +++ b/frontend/src/components/Authorize.tsx @@ -1,8 +1,9 @@ -import { ROUTES } from '@/constants/routes'; -import { useStore } from '@/store/useStore'; import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; +import { ROUTES } from '@/constants/routes'; +import { useStore } from '@/store/useStore'; + type AuthorizeProps = { children: React.ReactNode; id: number; diff --git a/frontend/src/components/Form/CreateBaseMapForm.tsx b/frontend/src/components/Form/CreateBaseMapForm.tsx index a9574753..4202e73d 100644 --- a/frontend/src/components/Form/CreateBaseMapForm.tsx +++ b/frontend/src/components/Form/CreateBaseMapForm.tsx @@ -1,11 +1,14 @@ -import FormWrapper from './FormWrapper'; -import BaseWrapper from '../common/BaseWrapper'; import { useNavigate } from 'react-router-dom'; + +import BaseWrapper from '@/components/common/BaseWrapper'; +import FormWrapper from './FormWrapper'; + import { useAddMapMutation } from '@/hooks/api/useAddMapMutation'; import { useMapForm } from '@/hooks/useMapForm'; +import { useStore } from '@/store/useStore'; + import { CreateMapType } from '@/types'; import { ROUTES } from '@/constants/routes'; -import { useStore } from '@/store/useStore'; const CreateBaseMapForm = () => { const { mapInfo, updateMapInfo, isMapInfoValid } = useMapForm(); diff --git a/frontend/src/components/Form/EditCourseForm.tsx b/frontend/src/components/Form/EditCourseForm.tsx index 8d278ed7..449496d5 100644 --- a/frontend/src/components/Form/EditCourseForm.tsx +++ b/frontend/src/components/Form/EditCourseForm.tsx @@ -1,12 +1,13 @@ import React from 'react'; -import BaseWrapper from '../common/BaseWrapper'; +import { useNavigate } from 'react-router-dom'; + +import BaseWrapper from '@/components/common/BaseWrapper'; import FormWrapper from './FormWrapper'; -import { BaseMap, Course } from '@/types'; + import { useEditCourseMutation } from '@/hooks/api/useEditCourseMutation'; import { useMapForm } from '@/hooks/useMapForm'; - -import { useNavigate } from 'react-router-dom'; import { useStore } from '@/store/useStore'; +import { BaseMap, Course } from '@/types'; type EditCourseFormProps = { courseData: Course; diff --git a/frontend/src/components/Form/EditMapForm.tsx b/frontend/src/components/Form/EditMapForm.tsx index 7502546e..31240979 100644 --- a/frontend/src/components/Form/EditMapForm.tsx +++ b/frontend/src/components/Form/EditMapForm.tsx @@ -1,12 +1,13 @@ import React from 'react'; -import BaseWrapper from '../common/BaseWrapper'; +import { useNavigate } from 'react-router-dom'; + +import BaseWrapper from '@/components/common/BaseWrapper'; import FormWrapper from './FormWrapper'; -import { BaseMap, Map } from '@/types'; + import { useEditMapMutation } from '@/hooks/api/useEditMapMutation'; import { useMapForm } from '@/hooks/useMapForm'; - -import { useNavigate } from 'react-router-dom'; import { useStore } from '@/store/useStore'; +import { BaseMap, Map } from '@/types'; type EditMapFormProps = { mapData: Map; diff --git a/frontend/src/components/Form/FormWrapper.tsx b/frontend/src/components/Form/FormWrapper.tsx index 9a911113..f64e9549 100644 --- a/frontend/src/components/Form/FormWrapper.tsx +++ b/frontend/src/components/Form/FormWrapper.tsx @@ -1,9 +1,11 @@ -import { BaseMap, CreateMapType } from '@/types'; import ImageUploader from './ImageUploader'; -import TextInputArea from '../common/TextInputArea'; import VisibilitySelector from './VisibilitySelector'; -import Box from '../common/Box'; -import DashBoardHeader from '../common/DashBoardHeader'; + +import Box from '@/components/common/Box'; +import TextInputArea from '@/components/common/TextInputArea'; +import DashBoardHeader from '@/components/common/DashBoardHeader'; + +import { BaseMap, CreateMapType } from '@/types'; type FormWrapperProps = { header: string; diff --git a/frontend/src/components/Form/ImageIcon.tsx b/frontend/src/components/Form/ImageIcon.tsx index e300f7ab..7ab219da 100644 --- a/frontend/src/components/Form/ImageIcon.tsx +++ b/frontend/src/components/Form/ImageIcon.tsx @@ -1,9 +1,3 @@ -import React from 'react'; - -/** - * 이미지 업로드에 쓰이는 아이콘 컴포넌트입니다. - */ - const ImageIcon = () => { return ( { - return ( - - - - - - ); -}; - -export default PinIcon; diff --git a/frontend/src/components/Place/AddPlaceButton.tsx b/frontend/src/components/Place/AddPlaceButton.tsx index d96e5758..420c3f00 100644 --- a/frontend/src/components/Place/AddPlaceButton.tsx +++ b/frontend/src/components/Place/AddPlaceButton.tsx @@ -1,5 +1,6 @@ +import Box from '@/components/common/Box'; + import { useStore } from '@/store/useStore'; -import Box from '../common/Box'; type AddPlaceButtonProps = { onClick: () => void; diff --git a/frontend/src/components/Place/DeletePlaceButton.tsx b/frontend/src/components/Place/DeletePlaceButton.tsx index 29be18b5..05ac91f2 100644 --- a/frontend/src/components/Place/DeletePlaceButton.tsx +++ b/frontend/src/components/Place/DeletePlaceButton.tsx @@ -1,10 +1,12 @@ +import { useMemo } from 'react'; +import { useParams } from 'react-router-dom'; + +import DeleteIcon from '@/components/common/DeleteIcon'; + import useDeletePlaceMutation from '@/hooks/api/useDeletePlaceMutation'; +import { usePutPlaceToCourseMutation } from '@/hooks/api/usePutPlaceToCourseMutation'; import { useStore } from '@/store/useStore'; import { CreateMapType, CustomPlace, Place } from '@/types'; -import { useParams } from 'react-router-dom'; -import DeleteIcon from '../common/DeleteIcon'; -import { usePutPlaceToCourseMutation } from '@/hooks/api/usePutPlaceToCourseMutation'; -import { useMemo } from 'react'; type DeletePlaceButtonProps = { placeId: number; diff --git a/frontend/src/components/Place/DetailPlaceForm.tsx b/frontend/src/components/Place/DetailPlaceForm.tsx index 51ebc99d..71262ee7 100644 --- a/frontend/src/components/Place/DetailPlaceForm.tsx +++ b/frontend/src/components/Place/DetailPlaceForm.tsx @@ -1,10 +1,14 @@ -import { useStore } from '@/store/useStore'; +import { useMemo, useState } from 'react'; + +import TextInputArea from '@/components/common/TextInputArea'; +import Box from '@/components/common/Box'; +import DashBoardHeader from '@/components/common/DashBoardHeader'; import PlaceItem from './PlaceItem'; -import TextInputArea from '../common/TextInputArea'; -import { useCallback, useMemo, useState } from 'react'; -import Box from '../common/Box'; -import DashBoardHeader from '../common/DashBoardHeader'; +import ColorSelector from '@/pages/PlaceCreation/ColorSelector'; +import { useAddPlaceMutation } from '@/hooks/api/useAddPlaceMutation'; +import { usePutPlaceToCourseMutation } from '@/hooks/api/usePutPlaceToCourseMutation'; +import { useStore } from '@/store/useStore'; import { CoursePlace, CreateMapType, @@ -12,9 +16,6 @@ import { MarkerColor, Place, } from '@/types'; -import ColorSelector from '@/pages/PlaceCreation/ColorSelector'; -import { useAddPlaceMutation } from '@/hooks/api/useAddPlaceMutation'; -import { usePutPlaceToCourseMutation } from '@/hooks/api/usePutPlaceToCourseMutation'; type DetailPlaceFormProps = { oncloseModal: () => void; diff --git a/frontend/src/components/Place/PlaceDetailPanel.tsx b/frontend/src/components/Place/PlaceDetailPanel.tsx index ae62e625..ec99595c 100644 --- a/frontend/src/components/Place/PlaceDetailPanel.tsx +++ b/frontend/src/components/Place/PlaceDetailPanel.tsx @@ -1,9 +1,9 @@ -import { CustomPlace, Place } from '@/types'; -import BaseWrapper from '../common/BaseWrapper'; -import DashBoardHeader from '../common/DashBoardHeader'; -import Box from '../common/Box'; +import BaseWrapper from '@/components/common/BaseWrapper'; +import PrevIcon from '@/components/common/PrevIcon'; +import Box from '@/components/common/Box'; import PlaceItem from './PlaceItem'; -import PrevIcon from '../common/PrevIcon'; + +import { CustomPlace, Place } from '@/types'; type PlaceDetailPanelProps = { place: Place & CustomPlace; diff --git a/frontend/src/components/Place/PlaceItem.tsx b/frontend/src/components/Place/PlaceItem.tsx index 0fe0770c..ff5ba8f7 100644 --- a/frontend/src/components/Place/PlaceItem.tsx +++ b/frontend/src/components/Place/PlaceItem.tsx @@ -1,8 +1,9 @@ +import DeletePlaceButton from './DeletePlaceButton'; +import ImageWithSkeleton from '../ImageSkeleton'; + import { useStore } from '@/store/useStore'; import { CustomPlace, Place } from '@/types'; -import DeletePlaceButton from './DeletePlaceButton'; -import ImageWithSkeleton from '../ImageSkeleton'; type PlaceItemProps = { place: Place; places?: (Place & CustomPlace)[]; diff --git a/frontend/src/components/Place/PlaceListPanel.tsx b/frontend/src/components/Place/PlaceListPanel.tsx index c917b057..5360d9ce 100644 --- a/frontend/src/components/Place/PlaceListPanel.tsx +++ b/frontend/src/components/Place/PlaceListPanel.tsx @@ -1,13 +1,15 @@ -import { CustomPlace, Place } from '@/types'; -import BaseWrapper from '../common/BaseWrapper'; -import Box from '../common/Box'; -import PlaceItem from './PlaceItem'; import { useCallback, useMemo, useState } from 'react'; -import Marker from '../Marker/Marker'; import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd'; + +import BaseWrapper from '@/components/common/BaseWrapper'; +import Box from '@/components/common/Box'; +import Marker from '@/components/Marker/Marker'; +import Polyline from '@/components/Marker/Polyline'; +import PlaceItem from './PlaceItem'; + import { usePutPlaceToCourseMutation } from '@/hooks/api/usePutPlaceToCourseMutation'; import { useStore } from '@/store/useStore'; -import Polyline from '../Marker/Polyline'; +import { CustomPlace, Place } from '@/types'; type PlaceListPanelProps = { places: (Place & CustomPlace)[]; diff --git a/frontend/src/components/Place/SearchBar.tsx b/frontend/src/components/Place/SearchBar.tsx index 1a0da8e1..819737f0 100644 --- a/frontend/src/components/Place/SearchBar.tsx +++ b/frontend/src/components/Place/SearchBar.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import SearchIcon from './SearchIcon'; type SearchBarProps = { diff --git a/frontend/src/components/Place/SearchGoogleResults.tsx b/frontend/src/components/Place/SearchGoogleResults.tsx index 185fce91..296fc5c7 100644 --- a/frontend/src/components/Place/SearchGoogleResults.tsx +++ b/frontend/src/components/Place/SearchGoogleResults.tsx @@ -1,6 +1,7 @@ -import { useGooglePlaceQuery } from '@/hooks/api/useGooglePlaceQuery'; import GooglePlaceItem from './GooglePlaceItem'; +import { useGooglePlaceQuery } from '@/hooks/api/useGooglePlaceQuery'; + type SearchGoogleResultsProps = { query: string; }; diff --git a/frontend/src/components/Place/SearchModeButtons.tsx b/frontend/src/components/Place/SearchModeButtons.tsx index 30bc82ce..011b4961 100644 --- a/frontend/src/components/Place/SearchModeButtons.tsx +++ b/frontend/src/components/Place/SearchModeButtons.tsx @@ -1,3 +1,5 @@ +import { useStore } from '@/store/useStore'; + const searchModeButtons = [ { mode: 'PLACE' as const, label: '장소 검색' }, { mode: 'GOOGLE' as const, label: '신규 장소 등록' }, @@ -12,13 +14,20 @@ const SearchModeButtons = ({ searchMode, setSearchMode, }: SearchModeButtonsProps) => { + const addToast = useStore((state) => state.addToast); return (
{searchModeButtons.map(({ mode, label }) => (
diff --git a/frontend/src/components/common/List/Map/MapItem.tsx b/frontend/src/components/common/List/Map/MapItem.tsx index 2653974c..45791d84 100644 --- a/frontend/src/components/common/List/Map/MapItem.tsx +++ b/frontend/src/components/common/List/Map/MapItem.tsx @@ -1,7 +1,7 @@ -import { MapItemType } from '@/types'; -import React from 'react'; import ListItem from '@/components/common/List/ListItem'; +import { MapItemType } from '@/types'; + type MapItemProps = { mapItem: MapItemType; }; diff --git a/frontend/src/components/common/Toast/Toast.tsx b/frontend/src/components/common/Toast/Toast.tsx index f760a9f3..2da591b5 100644 --- a/frontend/src/components/common/Toast/Toast.tsx +++ b/frontend/src/components/common/Toast/Toast.tsx @@ -11,6 +11,7 @@ const TOAST_STYLE = { error: 'bg-red-500 text-white', warning: 'bg-yellow-500 text-black', info: 'bg-blue-500 text-white', + default: 'bg-gray-500 text-white', }; const Toast = ({ diff --git a/frontend/src/constants/icon.ts b/frontend/src/constants/icon.ts deleted file mode 100644 index 89466c81..00000000 --- a/frontend/src/constants/icon.ts +++ /dev/null @@ -1,106 +0,0 @@ -export const ICONS = { - RED_PIN: () => ` - - - - - - -`, -}; diff --git a/frontend/src/lib/CustomMarkerClusterer.ts b/frontend/src/lib/CustomMarkerClusterer.ts index 6832177e..a4065d07 100644 --- a/frontend/src/lib/CustomMarkerClusterer.ts +++ b/frontend/src/lib/CustomMarkerClusterer.ts @@ -103,6 +103,11 @@ export class CustomMarkerClusterer extends MarkerClusterer { MarkerUtils.setMap(marker, null); }); }, 25); + // requestAnimationFrame(() => { + // groupMarkers.forEach((marker) => { + // MarkerUtils.setMap(marker, null); + // }); + // }); } google.maps.event.trigger( this, diff --git a/frontend/src/lib/SuperClusterAlgorithm.ts b/frontend/src/lib/SuperClusterAlgorithm.ts index b4d86330..da845246 100644 --- a/frontend/src/lib/SuperClusterAlgorithm.ts +++ b/frontend/src/lib/SuperClusterAlgorithm.ts @@ -26,7 +26,7 @@ export class SuperClusterAlgorithmTest extends SuperClusterViewportAlgorithm { }; let changed = !equal(this.state, state); - console.log('Origin changed', changed); + if (!equal(input.markers, this.markers)) { changed = true; // TODO use proxy to avoid copy? diff --git a/frontend/src/pages/CourseEditPage.tsx b/frontend/src/pages/CourseEditPage.tsx index 23c8758d..290f483e 100644 --- a/frontend/src/pages/CourseEditPage.tsx +++ b/frontend/src/pages/CourseEditPage.tsx @@ -1,11 +1,11 @@ +import { useParams } from 'react-router-dom'; + import Authorize from '@/components/Authorize'; import SideContainer from '@/components/common/SideContainer'; import EditCourseForm from '@/components/Form/EditCourseForm'; import { useCourseQuery } from '@/hooks/api/useCourseQuery'; -import { useParams } from 'react-router-dom'; - const CourseEditPage = () => { const { id } = useParams(); const courseData = useCourseQuery(Number(id)); diff --git a/frontend/src/pages/HomePage/HomePage.tsx b/frontend/src/pages/HomePage/HomePage.tsx index 43f102a0..cc6d1b62 100644 --- a/frontend/src/pages/HomePage/HomePage.tsx +++ b/frontend/src/pages/HomePage/HomePage.tsx @@ -1,12 +1,13 @@ +import { useNavigate } from 'react-router-dom'; + import Footer from '@/pages/HomePage/Footer'; import Header from '@/pages/HomePage/Header'; +import ArrowIcon from '@/components/common/DummyIcon'; +import BannerSlider from '@/components/Banner/BannerSlider'; import MainListPanel from './MainListPanel'; import { useStore } from '@/store/useStore'; -import { useNavigate } from 'react-router-dom'; -import BannerSlider from '@/components/Banner/BannerSlider'; -import ArrowIcon from '@/components/common/DummyIcon'; const Homepage = () => { const addToast = useStore((state) => state.addToast); diff --git a/frontend/src/pages/HomePage/LoginButtons.tsx b/frontend/src/pages/HomePage/LoginButtons.tsx index 2950252f..22282ea0 100644 --- a/frontend/src/pages/HomePage/LoginButtons.tsx +++ b/frontend/src/pages/HomePage/LoginButtons.tsx @@ -1,10 +1,12 @@ -import { useStore } from '@/store/useStore'; -import UserProfile from './UserProfile'; -import { useUserInfoQuery } from '@/hooks/api/useUserInfoQuery'; import { useEffect } from 'react'; -import { getRedirectUri } from '@/api/auth'; -import LogOutButton from './LogOutButton'; + import GoogleIcon from '@/components/common/GoogleIcon'; +import UserProfile from './UserProfile'; +import LogOutButton from './LogOutButton'; + +import { getRedirectUri } from '@/api/auth'; +import { useUserInfoQuery } from '@/hooks/api/useUserInfoQuery'; +import { useStore } from '@/store/useStore'; const LoginButtons = () => { const user = useStore((state) => state.user); diff --git a/frontend/src/pages/HomePage/MainListPanel.tsx b/frontend/src/pages/HomePage/MainListPanel.tsx index 3931c194..50d6eb5b 100644 --- a/frontend/src/pages/HomePage/MainListPanel.tsx +++ b/frontend/src/pages/HomePage/MainListPanel.tsx @@ -1,10 +1,12 @@ import { useState } from 'react'; + import CourseListPanel from '@/components/common/List/Course/CourseListPanel'; import MapListPanel from '@/components/common/List/Map/MapListPanel'; import ListToggleButtons from '@/components/common/List/ListToggleButtons'; -import { CreateMapType } from '@/types'; import SearchBar from '@/components/common/SearchBar'; +import { CreateMapType } from '@/types'; + type Range = 'ALL' | 'MY'; const MainListPanel = () => { diff --git a/frontend/src/pages/MapCreation/MapCreateCoursePage.tsx b/frontend/src/pages/MapCreation/MapCreateCoursePage.tsx index 5b80fdeb..904aae23 100644 --- a/frontend/src/pages/MapCreation/MapCreateCoursePage.tsx +++ b/frontend/src/pages/MapCreation/MapCreateCoursePage.tsx @@ -1,7 +1,9 @@ +import { useParams } from 'react-router-dom'; + import Authorize from '@/components/Authorize'; import SearchPanel from '@/components/Place/SearchPanel'; + import { useCourseQuery } from '@/hooks/api/useCourseQuery'; -import { useParams } from 'react-router-dom'; const MapCreateCoursePage = () => { const { id } = useParams(); diff --git a/frontend/src/pages/MapCreation/MapCreateMapPage.tsx b/frontend/src/pages/MapCreation/MapCreateMapPage.tsx index 191f4422..b3ef565c 100644 --- a/frontend/src/pages/MapCreation/MapCreateMapPage.tsx +++ b/frontend/src/pages/MapCreation/MapCreateMapPage.tsx @@ -1,10 +1,12 @@ +import { useEffect } from 'react'; +import { useParams } from 'react-router-dom'; + import Authorize from '@/components/Authorize'; import SearchPanel from '@/components/Place/SearchPanel'; + import { useMapQuery } from '@/hooks/api/useMapQuery'; import { useStore } from '@/store/useStore'; import { Place } from '@/types'; -import { useEffect } from 'react'; -import { useParams } from 'react-router-dom'; const MapCreateMapPage = () => { const { id } = useParams(); diff --git a/frontend/src/pages/MapDetail/MapDetailPage.tsx b/frontend/src/pages/MapDetail/MapDetailPage.tsx index d519527f..7302d0ca 100644 --- a/frontend/src/pages/MapDetail/MapDetailPage.tsx +++ b/frontend/src/pages/MapDetail/MapDetailPage.tsx @@ -1,6 +1,7 @@ +import { useParams } from 'react-router-dom'; + import MapDetailBoard from '@/components/Map/MapDetailBoard'; import { useMapQuery } from '@/hooks/api/useMapQuery'; -import { useParams } from 'react-router-dom'; const MapDetailPage = () => { const { id } = useParams(); diff --git a/frontend/src/pages/MapEditPage.tsx b/frontend/src/pages/MapEditPage.tsx index e15debfd..48f4576a 100644 --- a/frontend/src/pages/MapEditPage.tsx +++ b/frontend/src/pages/MapEditPage.tsx @@ -1,11 +1,11 @@ +import { useParams } from 'react-router-dom'; + import Authorize from '@/components/Authorize'; import SideContainer from '@/components/common/SideContainer'; import EditMapForm from '@/components/Form/EditMapForm'; import { useMapQuery } from '@/hooks/api/useMapQuery'; -import { useParams } from 'react-router-dom'; - const MapEditPage = () => { const { id } = useParams(); const mapData = useMapQuery(Number(id)); diff --git a/frontend/src/pages/PlaceCreation/ColorItem.tsx b/frontend/src/pages/PlaceCreation/ColorItem.tsx index 1777cb2c..c5c20af3 100644 --- a/frontend/src/pages/PlaceCreation/ColorItem.tsx +++ b/frontend/src/pages/PlaceCreation/ColorItem.tsx @@ -1,6 +1,8 @@ +import CheckIcon from '@/components/Place/CheckIcon'; + import { MarkerColor } from '@/types'; import { markerBgColor } from '@/constants/map'; -import CheckIcon from '@/components/Place/CheckIcon'; + type ColorItemProps = { color: MarkerColor; activeColor: MarkerColor | null; diff --git a/frontend/src/pages/PlaceCreation/ColorSelector.tsx b/frontend/src/pages/PlaceCreation/ColorSelector.tsx index 560deb10..8dc18c51 100644 --- a/frontend/src/pages/PlaceCreation/ColorSelector.tsx +++ b/frontend/src/pages/PlaceCreation/ColorSelector.tsx @@ -1,7 +1,8 @@ +import Box from '@/components/common/Box'; +import ColorItem from './ColorItem'; + import { MARKER_COLORS } from '@/constants/map'; import { MarkerColor } from '@/types'; -import ColorItem from './ColorItem'; -import Box from '@/components/common/Box'; type ColorSelectorProps = { activeColor: MarkerColor | null; diff --git a/frontend/src/pages/RedirectPage.tsx b/frontend/src/pages/RedirectPage.tsx index cb62e65a..242041f5 100644 --- a/frontend/src/pages/RedirectPage.tsx +++ b/frontend/src/pages/RedirectPage.tsx @@ -1,7 +1,8 @@ -import { useLogInMutation } from '@/hooks/api/useLoginMutation'; import { useEffect } from 'react'; import { useSearchParams } from 'react-router-dom'; +import { useLogInMutation } from '@/hooks/api/useLoginMutation'; + const RedirectPage = () => { const [searchParams] = useSearchParams(); diff --git a/frontend/src/pages/SearchPage/SearchListPanel.tsx b/frontend/src/pages/SearchPage/SearchListPanel.tsx deleted file mode 100644 index 92afd2a8..00000000 --- a/frontend/src/pages/SearchPage/SearchListPanel.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { useState } from 'react'; -import CourseListPanel from '@/components/common/List/Course/CourseListPanel'; -import MapListPanel from '@/components/common/List/Map/MapListPanel'; -import ListToggleButtons from '@/components/common/List/ListToggleButtons'; -import { CreateMapType } from '@/types'; - -interface SearchListPanelProps { - query?: string; -} - -const SearchListPanel: React.FC = ({ query }) => { - const [listTab, setListTab] = useState('MAP'); - - return ( -
- setListTab(value as CreateMapType)} - /> - -
- {listTab === 'MAP' ? ( - - ) : ( - - )} -
-
- ); -}; - -export default SearchListPanel; diff --git a/frontend/src/router/router.tsx b/frontend/src/router/router.tsx index 21a68f2c..a789b930 100644 --- a/frontend/src/router/router.tsx +++ b/frontend/src/router/router.tsx @@ -1,13 +1,13 @@ +import { Suspense } from 'react'; +import { createBrowserRouter } from 'react-router-dom'; + import ErrorBoundary from '@/components/Error/ErrorBoundary'; import ErrorFallback from '@/components/Error/ErrorFallback'; -import { createBrowserRouter } from 'react-router-dom'; + import Root from './Root'; -import { Suspense } from 'react'; import Homepage from '@/pages/HomePage/HomePage'; import LayoutCreate from '@/LayoutCreate'; - import MapPage from '@/pages/MapCreation/MapPage'; - import RedirectPage from '@/pages/RedirectPage'; import NotFound from '@/pages/NotFound'; import Loading from '@/pages/MapDetail/Loading'; diff --git a/frontend/src/store/googleMapSlice/index.ts b/frontend/src/store/googleMapSlice/index.ts index 38b9396a..239fe380 100644 --- a/frontend/src/store/googleMapSlice/index.ts +++ b/frontend/src/store/googleMapSlice/index.ts @@ -1,5 +1,6 @@ -import { INITIAL_MAP_CONFIG } from '@/constants/map'; import { StateCreator } from 'zustand'; + +import { INITIAL_MAP_CONFIG } from '@/constants/map'; import { StoreState } from '@/types'; import { getGoogleMapClass, diff --git a/frontend/src/store/placeSlice/index.ts b/frontend/src/store/placeSlice/index.ts index 4d29f3ab..6186473c 100644 --- a/frontend/src/store/placeSlice/index.ts +++ b/frontend/src/store/placeSlice/index.ts @@ -1,6 +1,7 @@ -import { Place, StoreState } from '@/types'; import { StateCreator } from 'zustand'; +import { Place, StoreState } from '@/types'; + export type PlaceState = { place: Place; places: Place[]; diff --git a/frontend/src/store/toastSlice/index.ts b/frontend/src/store/toastSlice/index.ts index 10669a28..441e909f 100644 --- a/frontend/src/store/toastSlice/index.ts +++ b/frontend/src/store/toastSlice/index.ts @@ -1,6 +1,7 @@ -import { StoreState } from '@/types'; import { StateCreator } from 'zustand'; +import { StoreState } from '@/types'; + let toastId = 0; export type ToastState = { @@ -8,7 +9,7 @@ export type ToastState = { addToast: ( message: string, attributes: string, - variant: 'success' | 'error' | 'warning' | 'info', + variant: 'success' | 'error' | 'warning' | 'info' | 'default', ) => number; removeToast: (id: number) => void; }; @@ -17,7 +18,7 @@ export type ToastType = { id: number; message: string; attributes: string; - variant: 'success' | 'error' | 'warning' | 'info'; + variant: 'success' | 'error' | 'warning' | 'info' | 'default'; }; export const createToastSlice: StateCreator = ( diff --git a/frontend/src/store/useStore.ts b/frontend/src/store/useStore.ts index 20e338dc..07fc92a0 100644 --- a/frontend/src/store/useStore.ts +++ b/frontend/src/store/useStore.ts @@ -1,10 +1,12 @@ import { create } from 'zustand'; -import { StoreState } from '@/types'; + import { createGoogleMapSlice } from '@/store/googleMapSlice'; import { createPlaceSlice } from '@/store/placeSlice'; import { createToastSlice } from './toastSlice'; import { createAuthSlice } from './userSlice'; +import { StoreState } from '@/types'; + export const useStore = create()((...a) => ({ ...createGoogleMapSlice(...a), ...createPlaceSlice(...a), diff --git a/frontend/src/store/userSlice/index.ts b/frontend/src/store/userSlice/index.ts index ef424ee4..ab0a6ea5 100644 --- a/frontend/src/store/userSlice/index.ts +++ b/frontend/src/store/userSlice/index.ts @@ -1,6 +1,7 @@ -import { StoreState, User } from '@/types'; import { StateCreator } from 'zustand'; +import { StoreState, User } from '@/types'; + export type AuthState = { isLogged: boolean; user: User | null;