Skip to content

Commit

Permalink
fix: Adjust decoded tx ui
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Jul 5, 2023
1 parent 55cdf74 commit e0fec72
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { AccordionProps } from '@mui/material/Accordion/Accordion'
import SingleTxDecoded from '@/components/transactions/TxDetails/TxData/DecodedData/SingleTxDecoded'
import { Box, Button, Divider, Stack } from '@mui/material'
import css from './styles.module.css'
import classnames from 'classnames'

type MultisendProps = {
txData?: TransactionData
Expand All @@ -17,16 +18,18 @@ type MultisendProps = {
const MultisendActionsHeader = ({
setOpen,
amount,
compact = false,
}: {
setOpen: Dispatch<SetStateAction<Record<number, boolean> | undefined>>
amount: number
compact?: boolean
}) => {
const onClickAll = (expanded: boolean) => () => {
setOpen(Array(amount).fill(expanded))
}

return (
<div className={css.actionsHeader}>
<div className={classnames(css.actionsHeader, { [css.compactHeader]: compact })}>
All actions
<Stack direction="row" divider={<Divider className={css.divider} />}>
<Button onClick={onClickAll(true)} variant="text">
Expand Down Expand Up @@ -78,9 +81,9 @@ export const Multisend = ({

return (
<>
<MultisendActionsHeader setOpen={setOpenMap} amount={multiSendTransactions.length} />
<MultisendActionsHeader setOpen={setOpenMap} amount={multiSendTransactions.length} compact={compact} />

<Box display="flex" flexDirection="column" gap={compact ? 1 : undefined}>
<Box display="flex" flexDirection="column" className={compact ? css.compact : ''}>
{multiSendTransactions.map(({ dataDecoded, data, value, to, operation }, index) => {
const onChange: AccordionProps['onChange'] = (_, expanded) => {
setOpenMap((prev) => ({
Expand All @@ -101,8 +104,8 @@ export const Multisend = ({
}}
txData={txData}
showDelegateCallWarning={showDelegateCallWarning}
actionTitle={`Action ${index + 1}`}
variant="elevation"
actionTitle={`${index + 1}`}
variant={compact ? 'outlined' : 'elevation'}
expanded={openMap?.[index] ?? false}
onChange={onChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
align-items: center;
}

.compactHeader {
border: 0;
}

.actionsHeader button {
padding-left: 18px;
padding-right: 18px;
Expand All @@ -18,3 +22,14 @@
margin-bottom: 14px;
border: 1px solid var(--color-border-light);
}

.compact > div:first-child {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}

.compact > div ~ div {
border-top-left-radius: 0;
border-top-right-radius: 0;
margin-top: -1px !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const SingleTxDecoded = ({
<Accordion variant={variant} expanded={expanded} onChange={onChange}>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<div className={css.summary}>
<CodeIcon />
<CodeIcon color="border" fontSize="small" />
<Typography>{actionTitle}</Typography>
<Typography ml="8px">
<b>{method}</b>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tx-flow/common/TxStatusWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const TxStatusWidget = ({
return (
<Paper>
<div className={css.header}>
<SafeLogo width={32} height={32} />
<SafeLogo width={32} height={32} className={css.logo} />
<Typography variant="h6" fontWeight="700" className={css.title}>
Transaction status
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
}

.logo {
width: 16px;
height: 16px;
width: 24px;
height: 24px;
margin-left: 16px;
}

Expand Down

0 comments on commit e0fec72

Please sign in to comment.