diff --git a/src/App.tsx b/src/App.tsx index 8c25c74..a728966 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import reactLogo from "./assets/react.svg"; import viteLogo from "/vite.svg"; import "./App.css"; @@ -13,6 +13,7 @@ import { CopyToClipboard } from "react-copy-to-clipboard"; import Download from "./assets/svgs/Download.svg"; import Logout from "./assets/svgs/Logout.svg"; import Return from "./assets/svgs/Return.svg"; +import Success from "./assets/svgs/Success.svg"; import { createAccount, generateRandomSentence, @@ -380,6 +381,12 @@ function App() { ); }; + // const rawWalletRef = useRef(null) + + // useEffect(()=> { + // rawWalletRef.current = rawWallet + // }, [rawWallet]) + useEffect(() => { try { chrome.runtime.sendMessage({ action: "getWalletInfo" }, (response) => { @@ -389,8 +396,9 @@ function App() { setExtstate("authenticated"); } }); + } catch (error) {} - }, [address]); + }, []); useEffect(() => { if (!address) return; @@ -480,7 +488,7 @@ function App() { } catch (error) {} }; - const returnToMain = ()=> { + const returnToMain = () => { setPaymentTo(""); setPaymentAmount(0); setPaymentPassword(""); @@ -489,8 +497,8 @@ function App() { setCountdown(null); setWalletToBeDownloaded(null); setWalletToBeDownloadedPassword(""); - setExtstate("authenticated") - } + setExtstate("authenticated"); + }; return ( {extState === "not-authenticated" && ( @@ -606,8 +614,8 @@ function App() { display: "flex", width: "100%", justifyContent: "flex-start", - paddingLeft: '22px', - boxSizing: 'border-box' + paddingLeft: "22px", + boxSizing: "border-box", }} > - - - Transfer QORT - - - - Balance: - - - {balance?.toFixed(2)} QORT - + + Transfer QORT + + + + Balance: + + + {balance?.toFixed(2)} QORT + @@ -669,7 +679,9 @@ function App() { autoComplete="off" /> - Amount + + Amount + -

- the application {requestConnection?.hostname} is requesting a - connection -

- - + + responseToConnectionRequest( + true, + requestConnection?.hostname, + requestConnection.interactionId + ) + } + > + accept + + + responseToConnectionRequest( + false, + requestConnection?.hostname, + requestConnection.interactionId + ) + } + > + decline + + )} {extState === "web-app-request-authentication" && ( <> -

the application {requestConnection?.hostname} you Authenticate

-

Either create a new account or import an existing one

- - + )} {extState === "download-wallet" && ( @@ -810,10 +867,23 @@ function App() { <> {!walletToBeDownloaded && ( <> - + + + + + Set up your Qortal account + + + Wallet password - - + + - + + Confirm wallet password - - + + - + + + + Create Account + {walletToBeDownloadedError} @@ -841,24 +917,51 @@ function App() { {walletToBeDownloaded && ( <> - + + + + + Congrats, you’re all set up! + + + { + saveFileToDiskFunc() + returnToMain() + }}> + Backup Account + )} )} - {countdown && ( - { - window.close(); + - {({ remainingTime }) => remainingTime} - + {/* */} + { + window.close(); + }} + size={75} + strokeWidth={8} + > + {({ remainingTime }) => {remainingTime}} + + )}
); diff --git a/src/assets/svgs/Success.svg b/src/assets/svgs/Success.svg new file mode 100644 index 0000000..c721476 --- /dev/null +++ b/src/assets/svgs/Success.svg @@ -0,0 +1,3 @@ + + +