From 68bb696c7803e2dc60b4e639e3e5319a4d4c4cad Mon Sep 17 00:00:00 2001 From: sohrab <4444588+sohrab-@users.noreply.github.com> Date: Wed, 3 Aug 2022 10:37:22 +1000 Subject: [PATCH] fix: alignItems to center instead of various margins --- src/App.tsx | 5 +-- src/components/Footer.tsx | 5 +-- src/components/client/InstructionHeader.tsx | 8 ++--- src/components/client/Transaction.tsx | 2 ++ src/components/client/TransactionHeader.tsx | 2 +- src/components/client/accounts/Account.tsx | 6 ++-- src/components/client/accounts/Accounts.tsx | 6 ++-- src/components/client/data/Data.tsx | 6 ++-- .../client/data/editor/DataField.tsx | 7 ++-- src/components/client/results/Results.tsx | 35 ++++++++++++------- src/components/client/results/Signature.tsx | 12 ++----- src/components/header/ColorModeSwitcher.tsx | 2 +- src/components/header/Header.tsx | 3 +- .../options/fields/ChoiceOption.tsx | 2 +- .../options/fields/NumberOption.tsx | 2 +- .../options/fields/RpcEndpointOption.tsx | 11 ++---- .../options/fields/ToggleOption.tsx | 2 +- .../palette/preview/AccountSummary.tsx | 4 +-- .../palette/preview/InstructionPreview.tsx | 6 ++-- .../palette/preview/TransactionPreview.tsx | 19 +++++----- 20 files changed, 68 insertions(+), 77 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8a0a6eb..8a126d9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -89,7 +89,7 @@ export const App: React.FC = () => { - + {/* TODO it's Solana wallet button's fault, we need to replace it */} @@ -103,8 +103,9 @@ export const App: React.FC = () => { {paletteOpen && ( + // TODO overlaps with main pane on smaller width - + diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 14c3634..06685e5 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -16,10 +16,11 @@ export const Footer: React.FC = () => ( p="3" templateColumns="repeat(3,1fr)" backgroundColor={useColorModeValue("gray.100", "gray.900")} + alignItems="center" > - + © {new Date().getFullYear()} - + diff --git a/src/components/client/InstructionHeader.tsx b/src/components/client/InstructionHeader.tsx index 191c272..bdfcf37 100644 --- a/src/components/client/InstructionHeader.tsx +++ b/src/components/client/InstructionHeader.tsx @@ -31,8 +31,8 @@ export const InstructionHeader: React.FC<{ index: number }> = ({ index }) => { const set = useSessionStoreWithUndo((state) => state.set); return ( - - + + = ({ index }) => { = ({ index }) => { = ({ index }) => { } diff --git a/src/components/client/Transaction.tsx b/src/components/client/Transaction.tsx index 600fb60..927d597 100644 --- a/src/components/client/Transaction.tsx +++ b/src/components/client/Transaction.tsx @@ -40,7 +40,9 @@ export const Transaction: React.FC = () => { + + diff --git a/src/components/client/TransactionHeader.tsx b/src/components/client/TransactionHeader.tsx index 5385045..cd777be 100644 --- a/src/components/client/TransactionHeader.tsx +++ b/src/components/client/TransactionHeader.tsx @@ -68,7 +68,7 @@ export const TransactionHeader: React.FC<{ transaction: ITransaction }> = ({ }; return ( - + = ({ }; return ( - - + + = ({ }> = ({ return ( - - + + Accounts - + = ({ return ( <> - - + + Data - + - + + { @@ -141,7 +139,6 @@ export const DataField: React.FC<{ { }; return ( - - - + + + Results {results.confirmationStatus === "finalized" ? ( results.error ? ( - - - + <> + + + Fail + + ) : ( - - - + <> + + + Success + + ) ) : ( signature && !inProgress && ( - - - + <> + + + Unknown + + ) )} @@ -180,7 +190,6 @@ export const Results: React.FC = () => { } variant="ghost" diff --git a/src/components/client/results/Signature.tsx b/src/components/client/results/Signature.tsx index a106e68..ce90000 100644 --- a/src/components/client/results/Signature.tsx +++ b/src/components/client/results/Signature.tsx @@ -22,14 +22,8 @@ export const Signature: React.FC<{ return ( <> - - + + Signature @@ -54,7 +48,7 @@ export const Signature: React.FC<{ - + {slot && ( diff --git a/src/components/header/ColorModeSwitcher.tsx b/src/components/header/ColorModeSwitcher.tsx index 007493e..02cbf55 100644 --- a/src/components/header/ColorModeSwitcher.tsx +++ b/src/components/header/ColorModeSwitcher.tsx @@ -21,7 +21,7 @@ export const ColorModeSwitcher: React.FC = (props) => { size="md" fontSize="lg" variant="ghost" - marginLeft="2" + ml="2" onClick={toggleColorMode} // maintain the colorMode for the element itself since the title bar is always in dark mode color="white" diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx index 0c9ed31..df1d582 100644 --- a/src/components/header/Header.tsx +++ b/src/components/header/Header.tsx @@ -24,7 +24,7 @@ export const Header: React.FC = () => { const set = useSessionStoreWithoutUndo((state) => state.set); return ( - + Logo @@ -32,7 +32,6 @@ export const Header: React.FC = () => { void; }> = ({ id, name, get, getChoices, set }) => ( <> - + {name} diff --git a/src/components/options/fields/NumberOption.tsx b/src/components/options/fields/NumberOption.tsx index f7ef1b8..1ac962d 100644 --- a/src/components/options/fields/NumberOption.tsx +++ b/src/components/options/fields/NumberOption.tsx @@ -16,7 +16,7 @@ export const NumberOption: React.FC<{ format?: (x: number) => any; }> = ({ id, name, get, set, format }) => ( <> - + {name} = ({ }; return ( - - + + void; }> = ({ id, name, get, set }) => ( <> - + {name} count > 0); return ( - + @@ -60,7 +60,7 @@ export const AccountSummary: React.FC<{ {tags.map(({ label, tooltip, count, colourScheme }, index) => ( - + {label}: {count} diff --git a/src/components/palette/preview/InstructionPreview.tsx b/src/components/palette/preview/InstructionPreview.tsx index 7db28c5..7c1e34a 100644 --- a/src/components/palette/preview/InstructionPreview.tsx +++ b/src/components/palette/preview/InstructionPreview.tsx @@ -35,9 +35,9 @@ export const InstructionPreview: React.FC<{ rounded="md" borderColor={useColorModeValue("gray.300", "gray.600")} > - + {/* TODO implement drag-and-drop */} - {/* */} + {/* */} - + {short(programId)} diff --git a/src/components/palette/preview/TransactionPreview.tsx b/src/components/palette/preview/TransactionPreview.tsx index ed221f4..a8be9d0 100644 --- a/src/components/palette/preview/TransactionPreview.tsx +++ b/src/components/palette/preview/TransactionPreview.tsx @@ -45,7 +45,7 @@ export const TransactionPreview: React.FC<{ boxShadow={useColorModeValue("base", "")} borderColor={useColorModeValue("gray.200", "gray.600")} > - + {/* TODO implement drag-and-drop */} {/* */} @@ -54,25 +54,27 @@ export const TransactionPreview: React.FC<{ {short(signature)} - + {error ? ( - + ) : ( - + )} - - {rpcEndpoint.network} - + + + {rpcEndpoint.network[0].toUpperCase()} + + - +