diff --git a/src/app/hitchhiking/page.tsx b/src/app/hitchhiking/page.tsx index d3fde5305..67068d8bc 100644 --- a/src/app/hitchhiking/page.tsx +++ b/src/app/hitchhiking/page.tsx @@ -11,6 +11,7 @@ import * as style from './hitchhiking.style' import ArrowDown from '@/icons/ArrowDown' import useAxiosWithAuth from '@/api/config' import { getUniqueArray } from '@/utils/getUniqueArray' +import useToast from '@/states/useToast' const Hitchhiking = () => { const [page, setPage] = useState(1) @@ -20,6 +21,8 @@ const Hitchhiking = () => { IPostCardHitchhiking[] >([]) + const { openToast } = useToast() + const axiosWithAuth = useAxiosWithAuth() const { isPc } = useMedia() @@ -65,7 +68,13 @@ const Hitchhiking = () => { } const addCard = () => { - if (draggedCardList.length === 0) return + if (draggedCardList.length === 0) { + openToast({ + message: '되돌아 갈 수 있는 마지막 카드예요.', + severity: 'info', + }) + return + } setCardList((prev: IPostCardHitchhiking[]) => { prev.push(draggedCardList[draggedCardList.length - 1]) if (cardList.length > 1) prev[prev.length - 2].hasBeenRemoved = false diff --git a/src/app/showcase/page.tsx b/src/app/showcase/page.tsx index c29e038dd..2badd764d 100644 --- a/src/app/showcase/page.tsx +++ b/src/app/showcase/page.tsx @@ -11,6 +11,7 @@ import { ICardData } from './panel/types' import useAuthStore from '@/states/useAuthStore' import CardContainer from './panel/CardContainer' import ShowcasePCLayout from './panel/ShowcasePc/ShowcasePcLayout' +import useToast from '@/states/useToast' const Showcase = () => { const [page, setPage] = useState(1) @@ -26,6 +27,8 @@ const Showcase = () => { : defaultGetFetcher, ) + const { openToast } = useToast() + useEffect(() => { if (!isLoading && data?.content) { setCardList((prev) => { @@ -50,7 +53,13 @@ const Showcase = () => { } const addCard = () => { - if (draggedCardList.length === 0) return + if (draggedCardList.length === 0) { + openToast({ + message: '되돌아 갈 수 있는 마지막 카드예요.', + severity: 'info', + }) + return + } setCardList((prev: ICardData[]) => { prev.push(draggedCardList[draggedCardList.length - 1]) if (cardList.length > 1) prev[prev.length - 2].hasBeenRemoved = false