From 1ddb66f8bbdf8bccf86d65271831eafc33965696 Mon Sep 17 00:00:00 2001 From: Geun-Oh Date: Sun, 7 Apr 2024 09:34:30 +0900 Subject: [PATCH] =?UTF-8?q?fixt:=20=EB=82=B4=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=A7=8C=20=EA=B8=80=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Card.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 6ae3b6b..b6c6864 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -18,6 +18,7 @@ import { deleteDaybookById } from '@api'; import monunImage from '../assets/images/monun_background.png'; import linenoteImage from '../assets/images/linenote_background.png'; +import { useLocation } from 'react-router-dom'; interface Props { daybook: GetDaybookResponse; @@ -44,6 +45,8 @@ const Card = ({ } = daybook; const hashtag = hashtags[0] as HashTagType; const Icon = hashtagIcon[hashtag]; + + const location = useLocation(); const deleteDaybook = async (id: number) => { if (confirm('정말 삭제하시겠습니까?') === true) { @@ -99,7 +102,7 @@ const Card = ({ {hashtags[0]}
- deleteDaybook(boardId)} /> + {location.pathname === '/my' && deleteDaybook(boardId)} />}