From 247568e433e850eb565bb82d49d7eead2607b017 Mon Sep 17 00:00:00 2001 From: Diogo Soares Date: Thu, 27 Oct 2022 15:25:12 +0200 Subject: [PATCH] refactor review rows --- src/components/new-safe/steps/Step3/index.tsx | 98 ++++++++++--------- 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/src/components/new-safe/steps/Step3/index.tsx b/src/components/new-safe/steps/Step3/index.tsx index 296eac39d6..606266f006 100644 --- a/src/components/new-safe/steps/Step3/index.tsx +++ b/src/components/new-safe/steps/Step3/index.tsx @@ -1,6 +1,6 @@ import { useMemo, type ReactElement } from 'react' import { FormProvider, useForm } from 'react-hook-form' -import { Button, Grid, Typography, Divider } from '@mui/material' +import { Button, Grid, Typography, Divider, Box } from '@mui/material' import StepCard from '@/components/new-safe/StepCard' import ChainIndicator from '@/components/common/ChainIndicator' import EthHashInfo from '@/components/common/EthHashInfo' @@ -26,6 +26,19 @@ type CreateSafeStep3Form = { const STEP_3_FORM_ID = 'create-safe-step-3-form' +const ReviewRow = ({ name, value }: { name: string; value: ReactElement }) => { + return ( + <> + + {name} + + + {value} + + + ) +} + const CreateSafeStep3 = (): ReactElement => { const chain = useCurrentChain() const { maxFeePerGas, maxPriorityFeePerGas } = useGasPrice() @@ -86,34 +99,26 @@ const CreateSafeStep3 = (): ReactElement => { - - Network - - - - - - Name - - - {newSafeName} - - - Owners - - - {safeOwners.map((owner, index) => ( - - ))} - - - Threshold - - - - {safeThreshold} out of {safeOwners.length} owner(s) - - + } /> + {newSafeName}} /> + + {safeOwners.map((owner, index) => ( + + ))} + + } + /> + + {safeThreshold} out of {safeOwners.length} owner(s) + + } + /> @@ -121,23 +126,24 @@ const CreateSafeStep3 = (): ReactElement => { - - Est. network fee - - - - - {totalFee} {chain?.nativeCurrency.symbol} - - - - - - - - You will have to confirm a transaction with your currently connected wallet. - - + + + {totalFee} {chain?.nativeCurrency.symbol} + + + } + /> + + You will have to confirm a transaction with your currently connected wallet. + + } + />