From d0a90983e0774b9c959b0566ad213c78a7d9e11d Mon Sep 17 00:00:00 2001 From: solo5star Date: Fri, 20 Oct 2023 12:41:09 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20alert=EB=A5=BC=20=ED=86=A0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=A9=94=EC=84=B8=EC=A7=80=EB=A1=9C=20=EB=8C=80?= =?UTF-8?q?=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/CafeMap.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/CafeMap.tsx b/client/src/components/CafeMap.tsx index f97d12fe..5f13f32a 100644 --- a/client/src/components/CafeMap.tsx +++ b/client/src/components/CafeMap.tsx @@ -1,6 +1,7 @@ import React, { Suspense, useEffect, useRef, useState } from 'react'; import { styled } from 'styled-components'; import { SEONGSU_BOUNDS_LOCATION, SEONGSU_CAFE_STREET_LOCATION, SEONGSU_MAP_INITIAL_ZOOM_SIZE } from '../constants'; +import { useToast } from '../context/ToastContext'; import useCafesNearLocation from '../hooks/useCafesNearLocation'; import useCurrentPosition from '../hooks/useCurrentPosition'; import CafeMarkersContainer from './CafeMarkersContainer'; @@ -43,6 +44,7 @@ type CafeMapContentProps = { const CafeMapContent = (props: CafeMapContentProps) => { const { map } = props; + const showToast = useToast(); const currentPosition = useCurrentPosition(); const { refetch } = useCafesNearLocation(map); @@ -62,7 +64,7 @@ const CafeMapContent = (props: CafeMapContentProps) => { setPosition(currentPosition); } else { // 경고 메시지를 표시합니다. - alert('서비스는 성수 지역에서만 이용 가능합니다.'); + showToast('warning', '서비스는 성수 지역에서만 이용 가능합니다.'); map.panTo(SEONGSU_CAFE_STREET_LOCATION); setPosition(SEONGSU_CAFE_STREET_LOCATION); }