From 5ccc74a719ac0283450c9bf0bb8d94f63c0e842f Mon Sep 17 00:00:00 2001 From: Cheng Wang Date: Thu, 24 Aug 2023 22:32:29 +0200 Subject: [PATCH 01/10] Update MyTable --- src/components/Misc/MyBox.tsx | 4 +- src/components/Misc/MyTable.tsx | 19 +- src/components/Multisig/CreateMultisig.tsx | 211 +++++++++++---------- src/components/Multisig/SignMultisigTx.tsx | 4 +- src/components/Wallet/WalletInfo.tsx | 4 +- 5 files changed, 117 insertions(+), 125 deletions(-) diff --git a/src/components/Misc/MyBox.tsx b/src/components/Misc/MyBox.tsx index 08a6c73..18643a8 100644 --- a/src/components/Misc/MyBox.tsx +++ b/src/components/Misc/MyBox.tsx @@ -8,8 +8,8 @@ function MyBox({ children, ...others }: MyTableProps) { return ( ({ backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : 'white', diff --git a/src/components/Misc/MyTable.tsx b/src/components/Misc/MyTable.tsx index 98116c9..6c7c9d7 100644 --- a/src/components/Misc/MyTable.tsx +++ b/src/components/Misc/MyTable.tsx @@ -1,11 +1,11 @@ import { - Box, SpacingValue, SystemProp, Table, Text, useMantineTheme, } from '@mantine/core' +import MyBox from './MyBox' function Caption({ caption }: { caption: string }) { const theme = useMantineTheme() @@ -39,29 +39,16 @@ function MyTable({ w, data }: MyTableProps) { )) return ( - ({ - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[5] - : theme.colors.gray[1], - textAlign: 'center', - padding: theme.spacing.xl, - borderRadius: theme.radius.md, - })} - > + {rows}
-
+ ) } diff --git a/src/components/Multisig/CreateMultisig.tsx b/src/components/Multisig/CreateMultisig.tsx index 62aa9b0..b77d68a 100644 --- a/src/components/Multisig/CreateMultisig.tsx +++ b/src/components/Multisig/CreateMultisig.tsx @@ -145,121 +145,126 @@ function CreateMultisig() { )) return ( - -
- - Choose a Name - - - - - - Signers - - - form.reorderListItem('pubkeys', { - from: source.index, - to: destination!.index, - }) - } - > - - {(provided) => ( -
- {fields} - {provided.placeholder} -
- )} -
-
+
+ + + + Choose a Name + + - - - - - + + {(provided) => ( +
+ {fields} + {provided.placeholder} +
+ )} +
+ - - - - Signatures Required - - - `${val} of ${form.values.pubkeys.length}`} - labelAlwaysOn - thumbSize={1} - styles={(theme) => ({ - label: { - backgroundColor: - theme.colorScheme === 'dark' - ? theme.colors.dark[3] - : theme.colors.blue[3], - }, - })} - /> - - handlers.current!.decrement()} + + + + + + + + + Signatures Required + + + `${val} of ${form.values.pubkeys.length}`} + labelAlwaysOn + thumbSize={1} + styles={(theme) => ({ + label: { + backgroundColor: + theme.colorScheme === 'dark' + ? theme.colors.dark[3] + : theme.colors.blue[3], + }, + })} /> + + handlers.current!.decrement()} + > + – + - handlers.current!.increment()} - > - + - + + form.setValues({ mOfN: val !== '' ? val : 1 }) + } + handlersRef={handlers} + max={form.values.pubkeys.length} + min={1} + step={1} + styles={{ input: { width: rem(54), textAlign: 'center' } }} + /> + + handlers.current!.increment()} + > + + + + - - - {/* */} + + {/* */} - - - - -
+ + + + + +
) } diff --git a/src/components/Multisig/SignMultisigTx.tsx b/src/components/Multisig/SignMultisigTx.tsx index eebeb95..149d7ef 100644 --- a/src/components/Multisig/SignMultisigTx.tsx +++ b/src/components/Multisig/SignMultisigTx.tsx @@ -69,7 +69,7 @@ function SignMultisigTx() { return ( - Multisig Transaction + Transaction to sign