forked from cerc-io/laconic-wallet-web
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: cerc-io/laconic-wallet-web#9
This commit is contained in:
parent
9a112783d2
commit
2455dd982b
@ -5,10 +5,13 @@ import styles from '../styles/stylesheet';
|
|||||||
import GridView from './Grid';
|
import GridView from './Grid';
|
||||||
import { CustomDialogProps } from '../types';
|
import { CustomDialogProps } from '../types';
|
||||||
|
|
||||||
|
|
||||||
const DialogComponent = ({ visible, hideDialog, contentText }: CustomDialogProps) => {
|
const DialogComponent = ({ visible, hideDialog, contentText }: CustomDialogProps) => {
|
||||||
const words = contentText.split(' ');
|
const words = contentText.split(' ');
|
||||||
|
|
||||||
|
const copyMnemonic = () => {
|
||||||
|
navigator.clipboard.writeText(contentText)
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={visible} onClose={hideDialog}>
|
<Dialog open={visible} onClose={hideDialog}>
|
||||||
<DialogTitle>Mnemonic</DialogTitle>
|
<DialogTitle>Mnemonic</DialogTitle>
|
||||||
@ -22,6 +25,7 @@ const DialogComponent = ({ visible, hideDialog, contentText }: CustomDialogProps
|
|||||||
<GridView words={words} />
|
<GridView words={words} />
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
<Button onClick={copyMnemonic}>Copy</Button>
|
||||||
<Button onClick={hideDialog}>Done</Button>
|
<Button onClick={hideDialog}>Done</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
Loading…
Reference in New Issue
Block a user