-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from spacemeshos/feat-edit-data
Implement edit/remove networks/accounts/keys.
- Loading branch information
Showing
20 changed files
with
1,599 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { useRef } from 'react'; | ||
|
||
import { | ||
AlertDialog, | ||
AlertDialogBody, | ||
AlertDialogCloseButton, | ||
AlertDialogContent, | ||
AlertDialogFooter, | ||
AlertDialogHeader, | ||
AlertDialogOverlay, | ||
Button, | ||
} from '@chakra-ui/react'; | ||
|
||
import useConfirmation from '../hooks/useConfirmation'; | ||
|
||
function ConfirmationAlert(): JSX.Element { | ||
const { disclosure } = useConfirmation(); | ||
const cancelRef = useRef<HTMLButtonElement>(null); | ||
|
||
return ( | ||
<AlertDialog | ||
leastDestructiveRef={cancelRef} | ||
isOpen={disclosure.isOpen} | ||
onClose={disclosure.onClose} | ||
isCentered | ||
size="lg" | ||
> | ||
<AlertDialogOverlay /> | ||
<AlertDialogContent> | ||
<AlertDialogCloseButton /> | ||
<AlertDialogHeader fontSize="lg" fontWeight="bold" textAlign="center"> | ||
{disclosure.header} | ||
</AlertDialogHeader> | ||
|
||
<AlertDialogBody>{disclosure.content}</AlertDialogBody> | ||
|
||
<AlertDialogFooter justifyContent="space-between"> | ||
<Button | ||
ref={cancelRef} | ||
onClick={disclosure.onClose} | ||
variant="whiteModal" | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
type="submit" | ||
variant={disclosure.isDanger ? 'danger' : 'whiteModal'} | ||
onClick={disclosure.onSubmit} | ||
ml={3} | ||
> | ||
{disclosure.actionLabel} | ||
</Button> | ||
</AlertDialogFooter> | ||
</AlertDialogContent> | ||
</AlertDialog> | ||
); | ||
} | ||
|
||
export default ConfirmationAlert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.