From a25cdadf138f5b4290698dac4884b5e53daf8539 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Fri, 16 Jun 2023 18:22:26 +0200 Subject: [PATCH] Extract CreateTxForm to /transaction/new --- components/forms/CreateTxForm/index.tsx | 7 +- pages/multi/[address]/index.tsx | 40 ++-------- pages/multi/[address]/transaction/new.tsx | 89 +++++++++++++++++++++++ 3 files changed, 101 insertions(+), 35 deletions(-) create mode 100644 pages/multi/[address]/transaction/new.tsx diff --git a/components/forms/CreateTxForm/index.tsx b/components/forms/CreateTxForm/index.tsx index 0ddd4ff..63eff73 100644 --- a/components/forms/CreateTxForm/index.tsx +++ b/components/forms/CreateTxForm/index.tsx @@ -84,7 +84,7 @@ const CreateTxForm = ({ router, senderAddress, accountOnChain }: CreateTxFormPro dataJSON: JSON.stringify(tx), }); - router.push(`${senderAddress}/transaction/${transactionID}`); + router.push(`/multi/${senderAddress}/transaction/${transactionID}`); } catch (error) { console.error("Creat transaction error:", error); setShowTxError(true); @@ -94,7 +94,10 @@ const CreateTxForm = ({ router, senderAddress, accountOnChain }: CreateTxFormPro }; return ( - +

Create New Transaction

{msgTypes.length ? ( msgTypes.map((msgType, index) => ( diff --git a/pages/multi/[address]/index.tsx b/pages/multi/[address]/index.tsx index 6dd8a6d..d2fd5aa 100644 --- a/pages/multi/[address]/index.tsx +++ b/pages/multi/[address]/index.tsx @@ -7,7 +7,6 @@ import { useCallback, useEffect, useState } from "react"; import HashView from "../../../components/dataViews/HashView"; import MultisigHoldings from "../../../components/dataViews/MultisigHoldings"; import MultisigMembers from "../../../components/dataViews/MultisigMembers"; -import CreateTxForm from "../../../components/forms/CreateTxForm"; import Button from "../../../components/inputs/Button"; import Page from "../../../components/layout/Page"; import StackableContainer from "../../../components/layout/StackableContainer"; @@ -70,7 +69,7 @@ const Multipage = () => { }, [fetchMultisig, multisigAddress]); return ( - + @@ -84,20 +83,7 @@ const Multipage = () => { threshold={pubkey.value.threshold} /> ) : null} -
-
- -
-
- -

New transaction

-

- Once a transaction is created, it can be signed by the multisig members, and then - broadcast. -

-
-
-
+ {accountError || !accountOnChain ? (
@@ -123,25 +109,13 @@ const Multipage = () => {
) : null} - {accountOnChain && multisigAddress ? ( - - ) : null} +