mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-22 21:36:25 +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()}
|
{dayjs(new Date(comment.createdAt)).fromNow()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Dropdown
|
{canDelete &&
|
||||||
placement="bottom-start"
|
<Dropdown
|
||||||
trigger={<CompactButton icon={DotsHorizontal} />}
|
placement="bottom-start"
|
||||||
>
|
trigger={<CompactButton icon={DotsHorizontal} />}
|
||||||
<DropdownItem
|
>
|
||||||
icon={Trash}
|
<DropdownItem
|
||||||
label={t("deleteComment")}
|
icon={Trash}
|
||||||
disabled={!canDelete}
|
label={t("deleteComment")}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
deleteComment.mutate({
|
deleteComment.mutate({
|
||||||
commentId: comment.id,
|
commentId: comment.id,
|
||||||
pollId,
|
pollId,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-fit whitespace-pre-wrap">
|
<div className="w-fit whitespace-pre-wrap">
|
||||||
<TruncatedLinkify>{comment.content}</TruncatedLinkify>
|
<TruncatedLinkify>{comment.content}</TruncatedLinkify>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue