Add button to copy mnemonic after creating new wallet (#9)

Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Co-authored-by: IshaVenikar <ishavenikar7@gmail.com>
Reviewed-on: #9
This commit is contained in:
nabarun 2024-08-07 11:39:10 +00:00
parent 9a112783d2
commit 2455dd982b

View File

@ -5,10 +5,13 @@ import styles from '../styles/stylesheet';
import GridView from './Grid';
import { CustomDialogProps } from '../types';
const DialogComponent = ({ visible, hideDialog, contentText }: CustomDialogProps) => {
const words = contentText.split(' ');
const copyMnemonic = () => {
navigator.clipboard.writeText(contentText)
};
return (
<Dialog open={visible} onClose={hideDialog}>
<DialogTitle>Mnemonic</DialogTitle>
@ -22,6 +25,7 @@ const DialogComponent = ({ visible, hideDialog, contentText }: CustomDialogProps
<GridView words={words} />
</DialogContent>
<DialogActions>
<Button onClick={copyMnemonic}>Copy</Button>
<Button onClick={hideDialog}>Done</Button>
</DialogActions>
</Dialog>