-
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(suite): add timer to solana tx modal
- Loading branch information
Showing
8 changed files
with
158 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...Modal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputTimer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from 'react'; | ||
|
||
import styled from 'styled-components'; | ||
|
||
import { Badge, Banner, Text } from '@trezor/components'; | ||
|
||
import { Translation } from 'src/components/suite/Translation'; | ||
|
||
const TimerBox = styled.div` | ||
font-variant-numeric: tabular-nums; | ||
`; | ||
|
||
type TransactionReviewOutputTimerProps = { | ||
remainingTime: number; | ||
isMinimal?: boolean; | ||
}; | ||
|
||
export const TransactionReviewOutputTimer = ({ | ||
isMinimal, | ||
remainingTime, | ||
}: TransactionReviewOutputTimerProps) => { | ||
if (isMinimal) { | ||
return ( | ||
<Badge variant="warning"> | ||
<TimerBox> | ||
<Translation | ||
id="TR_SOLANA_TX_CONFIRMATION_TIMER_SHORT" | ||
values={{ | ||
remainingTime, | ||
strong: chunks => <strong>{chunks}</strong>, | ||
}} | ||
/> | ||
</TimerBox> | ||
</Badge> | ||
); | ||
} | ||
|
||
return ( | ||
<Banner variant="warning" icon="hourglass"> | ||
<TimerBox> | ||
<Text typographyStyle="callout" as="div"> | ||
<Translation id="TR_SOLANA_TX_CONFIRMATION_TIMER" values={{ remainingTime }} /> | ||
</Text> | ||
<Translation id="TR_SOLANA_TX_CONFIRMATION_TIMER_DESCRIPTION" /> | ||
</TimerBox> | ||
</Banner> | ||
); | ||
}; |
25 changes: 25 additions & 0 deletions
25
...rc/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ExpiredBlockhash.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Box, Card, Column, IconCircle, Text } from '@trezor/components'; | ||
import { spacings } from '@trezor/theme'; | ||
import { HELP_CENTER_SOL_SEND } from '@trezor/urls'; | ||
|
||
import { Translation } from '../../../../Translation'; | ||
import { TrezorLink } from '../../../../TrezorLink'; | ||
|
||
export const ExpiredBlockhash = () => ( | ||
<Card fillType="flat"> | ||
<Column gap={spacings.xs}> | ||
<Box margin={{ bottom: spacings.md }}> | ||
<IconCircle name="warning" size={110} variant="destructive" /> | ||
</Box> | ||
|
||
<Text typographyStyle="titleSmall"> | ||
<Translation id="TR_SOLANA_TX_SEND_FAILED_TITLE" /> | ||
</Text> | ||
<Translation id="TR_SOLANA_TX_SEND_FAILED_DESCRIPTION" /> | ||
|
||
<TrezorLink typographyStyle="hint" href={HELP_CENTER_SOL_SEND} icon="arrowUpRight"> | ||
<Translation id="TR_LEARN_MORE" /> | ||
</TrezorLink> | ||
</Column> | ||
</Card> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters