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

feat: Show Proposal chip for unsigned transactions in the queue [SW-367] #4422

Merged
merged 1 commit into from
Oct 25, 2024
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
13 changes: 9 additions & 4 deletions src/components/transactions/TxSummary/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import TxProposalChip from '@/features/proposers/components/TxProposalChip'
import StatusLabel from '@/features/swap/components/StatusLabel'
import useIsExpiredSwap from '@/features/swap/hooks/useIsExpiredSwap'
import { Box } from '@mui/material'
Expand Down Expand Up @@ -74,10 +75,14 @@ const TxSummary = ({ item, isConflictGroup, isBulkGroup }: TxSummaryProps): Reac

{isQueue && executionInfo && (
<Box gridArea="confirmations">
<TxConfirmations
submittedConfirmations={executionInfo.confirmationsSubmitted}
requiredConfirmations={executionInfo.confirmationsRequired}
/>
{executionInfo.confirmationsSubmitted > 0 ? (
<TxConfirmations
submittedConfirmations={executionInfo.confirmationsSubmitted}
requiredConfirmations={executionInfo.confirmationsRequired}
/>
) : (
<TxProposalChip />
)}
</Box>
)}

Expand Down
32 changes: 32 additions & 0 deletions src/features/proposers/components/TxProposalChip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Chip, SvgIcon, Tooltip, Typography } from '@mui/material'
import InfoIcon from '@/public/images/notifications/info.svg'

const TxProposalChip = () => {
return (
<Tooltip title="This transaction was created by a Proposer. Reject or confirm it to proceed.">
<span>
<Chip
sx={{ backgroundColor: 'background.main', color: 'primary.light' }}
size="small"
label={
<Typography
variant="caption"
fontWeight="bold"
display="flex"
alignItems="center"
justifyContent="center"
gap={0.7}
>
<SvgIcon component={InfoIcon} inheritViewBox fontSize="small" />
<Typography variant="caption" fontWeight="bold">
Proposal
</Typography>
</Typography>
}
/>
</span>
</Tooltip>
)
}

export default TxProposalChip
Loading