Add button to copy mnemonic after creating new wallet #9

Merged
nabarun merged 1 commits from deep-stack/laconic-wallet-web:iv-copy-mnemonic into main 2024-08-07 11:39:11 +00:00

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>