mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-22 13:26:20 +02:00
💄 Hide comment dropdown menu when unavailable to user (#564)
This commit is contained in:
parent
182ff3b49c
commit
086091b67f
1 changed files with 17 additions and 16 deletions
|
@ -112,22 +112,23 @@ const Discussion: React.FunctionComponent = () => {
|
|||
{dayjs(new Date(comment.createdAt)).fromNow()}
|
||||
</span>
|
||||
</div>
|
||||
<Dropdown
|
||||
placement="bottom-start"
|
||||
trigger={<CompactButton icon={DotsHorizontal} />}
|
||||
>
|
||||
<DropdownItem
|
||||
icon={Trash}
|
||||
label={t("deleteComment")}
|
||||
disabled={!canDelete}
|
||||
onClick={() => {
|
||||
deleteComment.mutate({
|
||||
commentId: comment.id,
|
||||
pollId,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Dropdown>
|
||||
{canDelete &&
|
||||
<Dropdown
|
||||
placement="bottom-start"
|
||||
trigger={<CompactButton icon={DotsHorizontal} />}
|
||||
>
|
||||
<DropdownItem
|
||||
icon={Trash}
|
||||
label={t("deleteComment")}
|
||||
onClick={() => {
|
||||
deleteComment.mutate({
|
||||
commentId: comment.id,
|
||||
pollId,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Dropdown>
|
||||
}
|
||||
</div>
|
||||
<div className="w-fit whitespace-pre-wrap">
|
||||
<TruncatedLinkify>{comment.content}</TruncatedLinkify>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue