Skip to content

Commit

Permalink
Merge branch 'approval-details' of github.com:safe-global/safe-wallet…
Browse files Browse the repository at this point in the history
…-web into feat-staking-kiln
  • Loading branch information
katspaugh committed Aug 13, 2024
2 parents 28613c3 + bebe7d9 commit 1860841
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/tx/DecodedTx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const DecodedTx = ({
<HelpToolTip />
<Box flexGrow={1} />
{isMethodCallInAdvanced && decodedData?.method}
{!showMethodCall && !decodedData?.method && tx?.data.value && 'native transfer'}
</AccordionSummary>

<AccordionDetails data-testid="decoded-tx-details">
Expand Down
5 changes: 3 additions & 2 deletions src/components/tx/FieldsGrid/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { type ReactNode } from 'react'
import { Grid, Typography } from '@mui/material'

const minWidth = { xl: '25%', lg: '2vw' }
const minWidth = { xl: '25%', lg: '100px' }
const wrap = { flexWrap: { xl: 'nowrap' } }

const FieldsGrid = ({ title, children }: { title: string; children: ReactNode }) => {
return (
<Grid container alignItems="center" gap={1} wrap="nowrap">
<Grid container alignItems="center" gap={1} sx={wrap}>
<Grid item minWidth={minWidth}>
<Typography color="primary.light" noWrap>
{title}
Expand Down
7 changes: 5 additions & 2 deletions src/components/tx/SignOrExecuteForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { TwapFallbackHandlerWarning } from '@/features/swap/components/TwapFallb
import useIsSafeOwner from '@/hooks/useIsSafeOwner'
import useTxDetails from '@/hooks/useTxDetails'
import TxData from '@/components/transactions/TxDetails/TxData'
import { useApprovalInfos } from '../ApprovalEditor/hooks/useApprovalInfos'

export type SubmitCallback = (txId: string, isExecuted?: boolean) => void

Expand Down Expand Up @@ -94,6 +95,8 @@ export const SignOrExecuteForm = ({
const isSwapOrder = isConfirmationViewOrder(decodedData)
const [txDetails] = useTxDetails(props.txId)
const showTxDetails = props.txId && txDetails && !isCustomTxInfo(txDetails.txInfo)
const [readableApprovals] = useApprovalInfos({ safeTransaction: safeTx })
const isApproval = readableApprovals && readableApprovals.length > 0

const { safe } = useSafeInfo()
const isSafeOwner = useIsSafeOwner()
Expand Down Expand Up @@ -144,7 +147,7 @@ export const SignOrExecuteForm = ({
)}

<ErrorBoundary fallback={<div>Error parsing data</div>}>
<ApprovalEditor safeTransaction={safeTx} />
{isApproval && <ApprovalEditor safeTransaction={safeTx} />}

{showTxDetails && <TxData txDetails={txDetails} imitation={false} trusted />}

Expand All @@ -153,7 +156,7 @@ export const SignOrExecuteForm = ({
txId={props.txId}
decodedData={decodedData}
showMultisend={!props.isBatch}
showMethodCall={props.showMethodCall && !showTxDetails && !isSwapOrder}
showMethodCall={props.showMethodCall && !showTxDetails && !isSwapOrder && !isApproval}
/>
</ErrorBoundary>

Expand Down

0 comments on commit 1860841

Please sign in to comment.