Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add owner icon to confirmations #1436

Merged
merged 4 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/dashboard/PendingTxs/PendingTxListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import type { LinkProps } from 'next/link'
import type { ReactElement } from 'react'
import ChevronRight from '@mui/icons-material/ChevronRight'
import type { TransactionSummary } from '@safe-global/safe-gateway-typescript-sdk'
import { Box } from '@mui/material'
import { Box, SvgIcon, Typography } from '@mui/material'
import { isMultisigExecutionInfo } from '@/utils/transaction-guards'
import TxInfo from '@/components/transactions/TxInfo'
import TxType from '@/components/transactions/TxType'
import css from './styles.module.css'
import classNames from 'classnames'
import OwnersIcon from '@/public/images/common/owners.svg'

type PendingTxType = {
transaction: TransactionSummary
Expand All @@ -35,7 +36,10 @@ const PendingTx = ({ transaction, url }: PendingTxType): ReactElement => {
<Box gridArea="confirmations">
{isMultisigExecutionInfo(transaction.executionInfo) ? (
<Box className={css.confirmationsCount}>
{`${transaction.executionInfo.confirmationsSubmitted}/${transaction.executionInfo.confirmationsRequired}`}
<SvgIcon component={OwnersIcon} inheritViewBox fontSize="small" />
<Typography variant="caption" fontWeight="bold">
{`${transaction.executionInfo.confirmationsSubmitted}/${transaction.executionInfo.confirmationsRequired}`}
</Typography>
</Box>
) : (
<Box flexGrow={1} />
Expand Down
3 changes: 3 additions & 0 deletions src/components/dashboard/PendingTxs/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
}

.confirmationsCount {
display: flex;
align-items: center;
gap: var(--space-1);
padding: var(--space-1) 12px;
border-radius: 8px;
font-weight: bold;
Expand Down
10 changes: 4 additions & 6 deletions src/components/transactions/TxSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const TxSummary = ({ item, isGrouped }: TxSummaryProps): ReactElement => {
: undefined

const displayConfirmations = isQueue && !!submittedConfirmations && !!requiredConfirmations
const confirmationColor =
displayConfirmations && requiredConfirmations > submittedConfirmations ? 'border' : 'primary'

return (
<Box
Expand Down Expand Up @@ -82,12 +84,8 @@ const TxSummary = ({ item, isGrouped }: TxSummaryProps): ReactElement => {

{displayConfirmations && (
<Box gridArea="confirmations" display="flex" alignItems="center" gap={1}>
<SvgIcon component={OwnersIcon} inheritViewBox fontSize="small" color="border" />
<Typography
variant="caption"
fontWeight="bold"
color={requiredConfirmations > submittedConfirmations ? 'border.main' : 'primary'}
>
<SvgIcon component={OwnersIcon} inheritViewBox fontSize="small" color={confirmationColor} />
<Typography variant="caption" fontWeight="bold" color={confirmationColor}>
{submittedConfirmations} out of {requiredConfirmations}
</Typography>
</Box>
Expand Down