mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
comment deletion
This commit is contained in:
parent
59d544c5f4
commit
cf30f13eff
5 changed files with 49 additions and 11 deletions
|
@ -25,14 +25,18 @@ const Comment: FC<IProps> = memo(
|
|||
{...props}
|
||||
>
|
||||
<div className={styles.wrap}>
|
||||
{comment_group.comments.map(comment => (
|
||||
<CommentContent
|
||||
comment={comment}
|
||||
key={comment.id}
|
||||
can_edit={can_edit}
|
||||
onDelete={onDelete}
|
||||
/>
|
||||
))}
|
||||
{comment_group.comments.map(comment =>
|
||||
comment.deleted_at ? (
|
||||
<div key={comment.id}>deleted</div>
|
||||
) : (
|
||||
<CommentContent
|
||||
comment={comment}
|
||||
key={comment.id}
|
||||
can_edit={can_edit}
|
||||
onDelete={onDelete}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
</CommentWrapper>
|
||||
);
|
||||
|
|
|
@ -38,7 +38,7 @@ const CommentContent: FC<IProps> = memo(({ comment, can_edit, onDelete }) => {
|
|||
const lock = useMemo(
|
||||
() =>
|
||||
can_edit ? (
|
||||
<div className={styles.lock}>
|
||||
<div className={styles.lock} onClick={onLockClick}>
|
||||
<div>
|
||||
<Icon icon="close" />
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue