Skip to content

Commit

Permalink
fix: card kebab 버튼의 삭제/폴더에추가 클릭 시 여러 개 모달 띄워지는 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
O-daeun committed Jul 1, 2024
1 parent d14d83e commit 24f48c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export default function Card({ item, folders }: Props) {

const handleDeleteButtonClick = (e: MouseEvent) => {
e.preventDefault();
setModal({ isOpen: true, content: 'DeleteLinkModal' });
setModal({ isOpen: true, content: `DeleteLinkModal ${id}` });
};
const handleAddLinkButtonClick = (e: MouseEvent) => {
e.preventDefault();
setModal({ isOpen: true, content: 'AddLinkModal' });
setModal({ isOpen: true, content: `AddLinkModal ${id}` });
};

return (
Expand Down Expand Up @@ -96,9 +96,9 @@ export default function Card({ item, folders }: Props) {
</Link>
</S.Card>

{modal.isOpen && modal.content === 'DeleteLinkModal' ? (
{modal.isOpen && modal.content === `DeleteLinkModal ${id}` ? (
<DeleteLinkModal link={url} linkId={id} />
) : modal.content === 'AddLinkModal' ? (
) : modal.content === `AddLinkModal ${id}` ? (
<AddLinkModal link={url} folders={folders} />
) : (
''
Expand Down

0 comments on commit 24f48c8

Please sign in to comment.