Skip to content

Commit

Permalink
Update delete
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-bach committed Jun 7, 2024
1 parent fb64c26 commit 98753a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ X Update to codegen 5
- Build accounts page
X Add actions to create account
X Add actions to delete account
- Add modal to confirm deletion of account
X Add modal to confirm deletion of account
- Add modal to edit account
- Add loading screens
- Add environment variables to AppSync JS Resolvers/DynamoDB table
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/components/accounts/manage/render-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,30 @@ export const RenderCell = (data: Props) => {
<div className='flex items-center gap-4'>
<div>
<Tooltip content='Details'>
<button onClick={() => console.log('View account', data.account.accountId)}>
<Button isIconOnly variant='light' size='sm' onClick={() => console.log('View account', data.account.accountId)}>
<EyeIcon size={20} fill='#979797' />
</button>
</Button>
</Tooltip>
</div>
<div>
<Tooltip content='Edit account' color='secondary'>
<button onClick={() => console.log('Edit account', data.account.accountId)}>
<Button isIconOnly variant='light' size='sm' onClick={() => console.log('Edit account', data.account.accountId)}>
<EditIcon size={20} fill='#979797' />
</button>
</Button>
</Tooltip>
</div>
<div>
<Tooltip content='Delete account' color='danger'>
<button onClick={onOpen}>
<Button isIconOnly variant='light' size='sm' onClick={onOpen}>
<DeleteIcon size={20} fill='#FF0080' />
<Modal isOpen={isOpen} onOpenChange={onOpenChange} placement='top-center'>
<ModalContent>
{(onClose) => (
<form onSubmit={onSubmit}>
<ModalHeader className='flex flex-col gap-1'>Delete Account</ModalHeader>
<ModalHeader className='flex flex-col gap-1'>Delete account &quot;{data.account.name}&quot;?</ModalHeader>
<ModalBody>
Are you sure you want to delete this account?
<Input type='text' name='confirm' onChange={(e) => handleChange(e)} placeholder='Type "delete" to confirm' />
To confirm deletion, enter &apos;delete&apos; below
<Input type='text' name='confirm' onChange={(e) => handleChange(e)} placeholder='Enter "delete" to confirm' />
</ModalBody>
<ModalFooter>
<Button color='default' variant='flat' onClick={onClose}>
Expand All @@ -122,7 +122,7 @@ export const RenderCell = (data: Props) => {
)}
</ModalContent>
</Modal>
</button>
</Button>
</Tooltip>
</div>
</div>
Expand Down

0 comments on commit 98753a8

Please sign in to comment.