Skip to content

Commit

Permalink
fix: Signature Comment 수정(쓰레기통 2개 보이는 현상)
Browse files Browse the repository at this point in the history
  • Loading branch information
dydals3440 committed Feb 18, 2024
1 parent 2c3dd95 commit 54844b6
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/components/comment/signature/commentView/SignatureComment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,25 @@ const SignatureComment = ({ data }) => {
setEditMode(true);
}}
/>
<S.Icon
src={Trash}
onClick={async () => {
try {
await deleteReComment({ signatureId, commentId: _id });
} catch (e) {
console.error(e);
}
}}
/>
{!can_delete && ( // can_delete가 false일 때만 쓰레기통 아이콘 표시
<S.Icon
src={Trash}
onClick={async () => {
try {
await deleteReComment({ signatureId, commentId: _id });
} catch (e) {
console.error(e);
}
}}
/>
)}
</>
)}

{/* 모두 삭제하는 권한이 있는 경우. */}
{can_delete && !editMode && (
<>
{can_delete &&
!writer?.is_writer &&
!editMode && ( // writer가 아니고, can_delete가 true일 때만 쓰레기통 아이콘 표시
<S.Icon
src={Trash}
onClick={async () => {
Expand All @@ -150,8 +154,7 @@ const SignatureComment = ({ data }) => {
}
}}
/>
</>
)}
)}
{editMode && (
<>
<S.Button
Expand Down

0 comments on commit 54844b6

Please sign in to comment.