Skip to content

Commit

Permalink
Refactor: less css in tx summary
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Jan 10, 2025
1 parent 95d5711 commit aa35dfd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 65 deletions.
82 changes: 17 additions & 65 deletions apps/web/src/components/transactions/TxSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,57 +50,31 @@ const TxSummary = ({ item, isConflictGroup, isBulkGroup }: TxSummaryProps): Reac
id={tx.id}
>
{nonce !== undefined && !isConflictGroup && !isBulkGroup && (
<Box
data-testid="nonce"
className={css.nonce}
sx={{
gridArea: 'nonce',
}}
>
<Box data-testid="nonce" className={css.nonce} gridArea="nonce">
{nonce}
</Box>
)}

{(isImitationTransaction || !isTrusted) && (
<Box
data-testid="warning"
sx={{
gridArea: 'nonce',
}}
>
<Box data-testid="warning" gridArea="nonce">
<MaliciousTxWarning withTooltip={!isImitationTransaction} />
</Box>
)}
<Box
data-testid="tx-type"
sx={{
gridArea: 'type',
}}
>

<Box data-testid="tx-type" gridArea="type">
<TxType tx={tx} />
</Box>
<Box
data-testid="tx-info"
sx={{
gridArea: 'info',
}}
>

<Box data-testid="tx-info" gridArea="info">
<TxInfo info={tx.txInfo} />
</Box>
<Box
data-testid="tx-date"
className={css.date}
sx={{
gridArea: 'date',
}}
>

<Box data-testid="tx-date" className={css.date} gridArea="date">
<DateTime value={tx.timestamp} />
</Box>

{isQueue && executionInfo && (
<Box
sx={{
gridArea: 'confirmations',
}}
>
<Box gridArea="confirmations">
{executionInfo.confirmationsSubmitted > 0 || isPending ? (
<TxConfirmations
submittedConfirmations={executionInfo.confirmationsSubmitted}
Expand All @@ -111,37 +85,15 @@ const TxSummary = ({ item, isConflictGroup, isBulkGroup }: TxSummaryProps): Reac
)}
</Box>
)}
{isQueue && expiredSwap ? (
<Box
className={css.status}
sx={{
gridArea: 'status',
justifyContent: 'flex-end',
display: 'flex',
}}
>
<StatusLabel status="expired" />
</Box>
) : !isQueue || isPending ? (
<Box
className={css.status}
sx={{
gridArea: 'status',
justifyContent: 'flex-end',
display: 'flex',
}}
>
<TxStatusLabel tx={tx} />

{(!isQueue || expiredSwap || isPending) && (
<Box className={css.status} gridArea="status">
{isQueue && expiredSwap ? <StatusLabel status="expired" /> : <TxStatusLabel tx={tx} />}
</Box>
) : (
''
)}

{isQueue && !expiredSwap && (
<Box
sx={{
gridArea: 'actions',
}}
>
<Box gridArea="actions">
<QueueActions tx={tx} />
</Box>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@

.gridContainer .status {
margin-right: var(--space-3);
display: flex;
justify-content: flex-end;
}

.date {
Expand Down

0 comments on commit aa35dfd

Please sign in to comment.