From e05ce4659ec5e27ead673397f586bc35c836926c Mon Sep 17 00:00:00 2001 From: Cody Bender Date: Fri, 9 Aug 2024 16:10:15 -0400 Subject: [PATCH] style: import wallet dialog --- src/components/ImportWalletDialog.tsx | 48 ++++++++++++++++++--------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/src/components/ImportWalletDialog.tsx b/src/components/ImportWalletDialog.tsx index f192eb7..e081035 100644 --- a/src/components/ImportWalletDialog.tsx +++ b/src/components/ImportWalletDialog.tsx @@ -1,17 +1,26 @@ -import React, { useEffect, useState } from 'react'; - -import { Dialog, DialogActions, DialogContent, DialogTitle, TextField, Grid, Button, Typography } from "@mui/material"; +import React, { useEffect, useState } from "react"; +import styles from "../styles/stylesheet"; +import { + Dialog, + DialogActions, + DialogContent, + DialogTitle, + TextField, + Grid, + Button, + Typography, +} from "@mui/material"; const ImportWalletDialog = ({ visible, hideDialog, - importWalletHandler + importWalletHandler, }: { visible: boolean; hideDialog: () => void; importWalletHandler: (recoveryPhrase: string) => Promise; }) => { - const [words, setWords] = useState(Array(12).fill('')); + const [words, setWords] = useState(Array(12).fill("")); const handleWordChange = (index: number, value: string) => { const newWords = [...words]; @@ -20,7 +29,7 @@ const ImportWalletDialog = ({ }; const handlePaste = (event: React.ClipboardEvent) => { - const pastedText = event.clipboardData.getData('Text'); + const pastedText = event.clipboardData.getData("Text"); const splitWords = pastedText.trim().split(/\s+/); if (splitWords.length === 12) { @@ -30,15 +39,17 @@ const ImportWalletDialog = ({ }; useEffect(() => { - setWords(Array(12).fill('')); - },[visible]); + setWords(Array(12).fill("")); + }, [visible]); return ( - Import your wallet from your mnemonic - - - (You can paste your entire mnemonic into the first textbox) + + Import your wallet from your mnemonic + + + + (You can paste your entire mnemonic into the first textbox) {words.map((word, index) => ( @@ -55,9 +66,16 @@ const ImportWalletDialog = ({ ))} - - - + + + );