💄 Hide comment dropdown menu when unavailable to user (#564)

This commit is contained in:
Jonas Höbenreich 2023-03-14 23:40:05 +01:00 committed by GitHub
parent 182ff3b49c
commit 086091b67f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,6 +112,7 @@ const Discussion: React.FunctionComponent = () => {
{dayjs(new Date(comment.createdAt)).fromNow()}
</span>
</div>
{canDelete &&
<Dropdown
placement="bottom-start"
trigger={<CompactButton icon={DotsHorizontal} />}
@ -119,7 +120,6 @@ const Discussion: React.FunctionComponent = () => {
<DropdownItem
icon={Trash}
label={t("deleteComment")}
disabled={!canDelete}
onClick={() => {
deleteComment.mutate({
commentId: comment.id,
@ -128,6 +128,7 @@ const Discussion: React.FunctionComponent = () => {
}}
/>
</Dropdown>
}
</div>
<div className="w-fit whitespace-pre-wrap">
<TruncatedLinkify>{comment.content}</TruncatedLinkify>