fix: show admin row action menus uniformly
This commit is contained in:
@@ -40,28 +40,33 @@
|
|||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{formatDate(user.createdAt)}</Table.Cell>
|
<Table.Cell>{formatDate(user.createdAt)}</Table.Cell>
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
{#if user.id !== data.currentUserId}
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Root>
|
<DropdownMenu.Trigger>
|
||||||
<DropdownMenu.Trigger>
|
{#snippet child({ props })}
|
||||||
{#snippet child({ props })}
|
<Button
|
||||||
<Button
|
variant="ghost"
|
||||||
variant="ghost"
|
size="icon-sm"
|
||||||
size="icon-sm"
|
aria-label={`Open actions for ${user.name}`}
|
||||||
aria-label={`Open actions for ${user.name}`}
|
{...props}
|
||||||
{...props}
|
>
|
||||||
>
|
<EllipsisVerticalIcon />
|
||||||
<EllipsisVerticalIcon />
|
</Button>
|
||||||
</Button>
|
{/snippet}
|
||||||
{/snippet}
|
</DropdownMenu.Trigger>
|
||||||
</DropdownMenu.Trigger>
|
<DropdownMenu.Content align="end" class="w-36">
|
||||||
<DropdownMenu.Content align="end" class="w-36">
|
<DropdownMenu.Item
|
||||||
<DropdownMenu.Item onclick={() => openEdit(user)}>Edit</DropdownMenu.Item>
|
disabled={user.id === data.currentUserId}
|
||||||
<DropdownMenu.Item variant="destructive" onclick={() => openDelete(user)}>
|
onclick={() => openEdit(user)}>Edit</DropdownMenu.Item
|
||||||
Delete
|
>
|
||||||
</DropdownMenu.Item>
|
<DropdownMenu.Item
|
||||||
</DropdownMenu.Content>
|
variant="destructive"
|
||||||
</DropdownMenu.Root>
|
disabled={user.id === data.currentUserId}
|
||||||
{/if}
|
onclick={() => openDelete(user)}
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</DropdownMenu.Item>
|
||||||
|
</DropdownMenu.Content>
|
||||||
|
</DropdownMenu.Root>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
Reference in New Issue
Block a user