From d1cedaa1fb05e3e05fa20527f99d0c15cdc8a8bd Mon Sep 17 00:00:00 2001 From: hwinkr Date: Thu, 28 Dec 2023 21:04:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(delete=20unused=20file):=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - useLocationHandler 파일에서 현재 사용하고 있지 않은 예전 의존성을 사용하고 있어, 빌드 시 에러가 발생해 해당 파일을 삭제 --- src/hooks/useLocationHandler.ts | 41 --------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/hooks/useLocationHandler.ts diff --git a/src/hooks/useLocationHandler.ts b/src/hooks/useLocationHandler.ts deleted file mode 100644 index 44abd8eb..00000000 --- a/src/hooks/useLocationHandler.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { MODAL_MESSAGE } from '@constants/modal-messages'; -import { isUserInShcool } from '@utils/map'; -import { useEffect } from 'react'; - -import { CloseModal, OpenModal, modals } from './useModals'; -import useUserLocation from './useUserLocation'; - -type UserLocationHandler = ( - map: any, - openModal: OpenModal, - closeModal: CloseModal, -) => void; - -const useLocationHandler: UserLocationHandler = ( - map, - openModal, - closeModal, -) => { - const userLocation = useUserLocation(); - - useEffect(() => { - if (!map) return; - if (!userLocation) { - return openModal(modals.alert, { - message: MODAL_MESSAGE.ALERT.GET_LOCATION, - }); - } - closeModal(modals.alert); - - if (!isUserInShcool(userLocation.LAT, userLocation.LNG)) return; - const userLocationMarker = new window.kakao.maps.Marker({ - position: new window.kakao.maps.LatLng( - userLocation.LAT, - userLocation.LNG, - ), - }); - userLocationMarker.setMap(map); - }, [map, userLocation]); -}; - -export default useLocationHandler; From 1c7871803e1653086c7b4aa5665aec0d35e1d3d6 Mon Sep 17 00:00:00 2001 From: hwinkr Date: Thu, 28 Dec 2023 21:08:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix(add=20readonly=20type):=20TipData=20?= =?UTF-8?q?=EC=83=81=EC=88=98=20=EA=B0=9D=EC=B2=B4=EC=97=90=20readonly=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/List/TipCardList/index.tsx | 2 +- src/constants/tip.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/List/TipCardList/index.tsx b/src/components/List/TipCardList/index.tsx index fa9805c5..19b9e5c1 100644 --- a/src/components/List/TipCardList/index.tsx +++ b/src/components/List/TipCardList/index.tsx @@ -3,7 +3,7 @@ import styled from '@emotion/styled'; import React from 'react'; interface TipCardListProps { - tipList: TipData[]; + tipList: readonly TipData[]; tipItemRenderer: (tipItem: TipData) => JSX.Element; } diff --git a/src/constants/tip.ts b/src/constants/tip.ts index f0d76de2..190518ec 100644 --- a/src/constants/tip.ts +++ b/src/constants/tip.ts @@ -6,7 +6,7 @@ export interface TipData { link: string; } -export const SHORTCUT_DATA: TipData[] = [ +export const SHORTCUT_DATA: readonly TipData[] = [ { title: '부경대학교', subTitle: '부경대학교\n홈페이지로 이동', @@ -58,7 +58,7 @@ export const SHORTCUT_DATA: TipData[] = [ }, ] as const; -export const HONEY_TIP_DATA: TipData[] = [ +export const HONEY_TIP_DATA: readonly TipData[] = [ { title: '아우란트검사', subTitle: '인성·역량·취업준비도\n·진로적성검사',