Add button to copy mnemonic after creating new wallet #9
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user