From 95780b7b3c7b1bd20749521e19a193ae42a835fb Mon Sep 17 00:00:00 2001 From: KaffinPX Date: Fri, 28 Jun 2024 04:18:13 +0300 Subject: [PATCH] Merge Submit and Success --- src/pages/Wallet/Send.tsx | 11 ++--------- src/pages/Wallet/Send/Submit.tsx | 17 ++++++++++++----- src/pages/Wallet/Send/Success.tsx | 28 ---------------------------- 3 files changed, 14 insertions(+), 42 deletions(-) delete mode 100644 src/pages/Wallet/Send/Success.tsx diff --git a/src/pages/Wallet/Send.tsx b/src/pages/Wallet/Send.tsx index 3945d66..59ac324 100644 --- a/src/pages/Wallet/Send.tsx +++ b/src/pages/Wallet/Send.tsx @@ -15,14 +15,12 @@ import { useState } from "react" import { Dialog } from "@/components/ui/dialog" import Sign from "./Send/Sign" import Submit from "./Send/Submit" -import Success from "./Send/Success" import useURLParams from "@/hooks/useURLParams" export enum Tabs { Creation, Sign, Submit, - Success } export default function SendDrawer () { @@ -32,7 +30,6 @@ export default function SendDrawer () { const [ recipient, setRecipient ] = useState(params.get('recipient') ?? "") const [ amount, setAmount ] = useState(params.get('amount') ?? "") const [ transactions, setTransactions ] = useState() - const [ ids, setIds ] = useState() const [ error, setError ] = useState("") const [ tab, setTab ] = useState(Tabs.Creation) @@ -112,13 +109,9 @@ export default function SendDrawer () { setTransactions(transactions) setTab(Tabs.Submit) }} />} - {tab === Tabs.Submit && { - if (hash === 'send') return window.close() - - setIds(ids) - setTab(Tabs.Success) + {tab === Tabs.Submit && { + if (hash === 'send') window.close() }} />} - {tab === Tabs.Success && } diff --git a/src/pages/Wallet/Send/Submit.tsx b/src/pages/Wallet/Send/Submit.tsx index 782ac11..26f0c90 100644 --- a/src/pages/Wallet/Send/Submit.tsx +++ b/src/pages/Wallet/Send/Submit.tsx @@ -1,4 +1,4 @@ -import { Network } from "lucide-react" +import { NetworkIcon, PackageCheckIcon } from "lucide-react" import { DialogContent, DialogDescription, @@ -8,32 +8,39 @@ import { } from "@/components/ui/dialog" import { Button } from "@/components/ui/button" import useKaspa from "@/hooks/useKaspa" +import { useState } from "react" export default function Submit ({ transactions, onSubmitted }: { transactions: string[] - onSubmitted: (ids: string[]) => void + onSubmitted: () => void }) { const kaspa = useKaspa() + const [ ids, setIds ] = useState([]) return ( Submit Transaction - Submit your signed transaction batch to network, miners should verify and add it to a block. + Submit your signed transaction(s) to network, miners should add it to a block. + + diff --git a/src/pages/Wallet/Send/Success.tsx b/src/pages/Wallet/Send/Success.tsx deleted file mode 100644 index 678a45c..0000000 --- a/src/pages/Wallet/Send/Success.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog" -import { Button } from "@/components/ui/button" - -export default function Submit ({ ids }: { - ids: string[] -}) { - return ( - - - Success! - - Your transaction is being processed and verified by the miners. - - - - - - - ) -}