Skip to content

Commit

Permalink
fix: only render delete button if owner (#6837)
Browse files Browse the repository at this point in the history
* fix: only render delete button if owner

* fix: include divider in the conditional render
  • Loading branch information
foochifa authored Oct 31, 2023
1 parent 36c4761 commit 1760b2c
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const RowActionsDrawer = ({
previewFormLink,
handleDeleteForm,
handleDuplicateForm,
isFormAdmin,
handleCollaborators,
handleShareForm,
} = useRowAction(formMeta)
Expand Down Expand Up @@ -156,15 +157,19 @@ export const RowActionsDrawer = ({
<BiChevronRight fontSize="1.25rem" />
</Flex>
</Button>
<Divider />
<Button
{...buttonProps}
onClick={handleDeleteForm}
color="danger.500"
leftIcon={<BiTrash fontSize="1.25rem" />}
>
Delete
</Button>
{isFormAdmin && (
<>
<Divider />
<Button
{...buttonProps}
onClick={handleDeleteForm}
color="danger.500"
leftIcon={<BiTrash fontSize="1.25rem" />}
>
Delete
</Button>
</>
)}
</>
)}
</ButtonGroup>
Expand Down

0 comments on commit 1760b2c

Please sign in to comment.