Skip to content

Commit

Permalink
refactor: 새로운 Toast 컴포넌트로 교체
Browse files Browse the repository at this point in the history
  • Loading branch information
minjongbaek committed Dec 2, 2023
1 parent adf08e9 commit b55f27d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/bookshelf/[bookshelfId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { IconHeart, IconArrowLeft, IconShare, IconKakao } from '@public/icons';
import { useToast } from '@/hooks/toast';
import useToast from '@/ui/Base/Toast/useToast';
import useBookShelfBooksQuery from '@/queries/bookshelf/useBookShelfBookListQuery';
import useBookshelfInfoQuery from '@/queries/bookshelf/useBookshelfInfoQuery';
import {
Expand Down Expand Up @@ -31,7 +31,7 @@ export default function UserBookShelfPage({
const { data, isSuccess } = useBookshelfInfoQuery({ bookshelfId });
const { mutate: likeBookshelf } = useBookshelfLike(bookshelfId);
const { mutate: unlikeBookshelf } = useBookshelfUnlike(bookshelfId);
const { showToast } = useToast();
const { show: showToast } = useToast();
const router = useRouter();

if (!isSuccess) return null;
Expand All @@ -42,10 +42,10 @@ export default function UserBookShelfPage({
navigator.clipboard
.writeText(url)
.then(() => {
showToast({ message: '복사 성공!' });
showToast({ message: '링크를 복사했어요.', type: 'success' });
})
.catch(() => {
showToast({ message: '잠시 후 다시 시도해주세요' });
showToast({ message: '잠시 후 다시 시도해주세요', type: 'error' });
});
};

Expand Down

0 comments on commit b55f27d

Please sign in to comment.