Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alert를 토스트 메세지로 대체 #606

Merged
merged 3 commits into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/src/components/CafeMap.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -43,6 +44,7 @@ type CafeMapContentProps = {

const CafeMapContent = (props: CafeMapContentProps) => {
const { map } = props;
const showToast = useToast();

const currentPosition = useCurrentPosition();
const { refetch } = useCafesNearLocation(map);
Expand All @@ -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);
}
Expand Down
Loading