-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ui screens for new etna tx types
- Loading branch information
Showing
9 changed files
with
362 additions
and
102 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
45 changes: 45 additions & 0 deletions
45
src/pages/ApproveAction/components/ApproveDisableL1Validator.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,45 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { | ||
ApprovalSection, | ||
ApprovalSectionBody, | ||
ApprovalSectionHeader, | ||
} from '@src/components/common/approval/ApprovalSection'; | ||
import { TxDetailsRow } from '@src/components/common/approval/TxDetailsRow'; | ||
|
||
import { AvaxAmount } from './AvaxAmount'; | ||
import { Avalanche } from '@avalabs/core-wallets-sdk'; | ||
import { TruncatedIdentifier } from './TruncatedIdentifier'; | ||
|
||
export function ApproveDisableL1Validator({ | ||
tx, | ||
avaxPrice, | ||
}: { | ||
tx: Avalanche.DisableL1ValidatorTx; | ||
avaxPrice: number; | ||
}) { | ||
const { t } = useTranslation(); | ||
|
||
const { txFee, validationId } = tx; | ||
|
||
return ( | ||
<> | ||
<ApprovalSection sx={{ gap: 1 }}> | ||
<ApprovalSectionHeader label={t('Details')} /> | ||
<ApprovalSectionBody sx={{ justifyContent: 'start', py: 2.25 }}> | ||
<TxDetailsRow label={t('Validation ID')}> | ||
<TruncatedIdentifier identifier={validationId} /> | ||
</TxDetailsRow> | ||
</ApprovalSectionBody> | ||
</ApprovalSection> | ||
<ApprovalSection> | ||
<ApprovalSectionHeader label={t('Network Fee')} /> | ||
<ApprovalSectionBody> | ||
<TxDetailsRow label={t('Fee Amount')}> | ||
<AvaxAmount amount={txFee} avaxPrice={avaxPrice} /> | ||
</TxDetailsRow> | ||
</ApprovalSectionBody> | ||
</ApprovalSection> | ||
</> | ||
); | ||
} |
48 changes: 48 additions & 0 deletions
48
src/pages/ApproveAction/components/ApproveIncreaseL1ValidatorBalance.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 { useTranslation } from 'react-i18next'; | ||
|
||
import { | ||
ApprovalSection, | ||
ApprovalSectionBody, | ||
ApprovalSectionHeader, | ||
} from '@src/components/common/approval/ApprovalSection'; | ||
import { TxDetailsRow } from '@src/components/common/approval/TxDetailsRow'; | ||
|
||
import { AvaxAmount } from './AvaxAmount'; | ||
import { Avalanche } from '@avalabs/core-wallets-sdk'; | ||
import { TruncatedIdentifier } from './TruncatedIdentifier'; | ||
|
||
export function ApproveIncreaseL1ValidatorBalance({ | ||
tx, | ||
avaxPrice, | ||
}: { | ||
tx: Avalanche.IncreaseL1ValidatorBalanceTx; | ||
avaxPrice: number; | ||
}) { | ||
const { t } = useTranslation(); | ||
|
||
const { txFee, balance, validationId } = tx; | ||
|
||
return ( | ||
<> | ||
<ApprovalSection sx={{ gap: 1 }}> | ||
<ApprovalSectionHeader label={t('Details')} /> | ||
<ApprovalSectionBody sx={{ justifyContent: 'start', py: 2.25 }}> | ||
<TxDetailsRow label={t('Validation ID')}> | ||
<TruncatedIdentifier identifier={validationId} /> | ||
</TxDetailsRow> | ||
<TxDetailsRow label={t('Increase by amount')}> | ||
<AvaxAmount amount={balance} avaxPrice={avaxPrice} /> | ||
</TxDetailsRow> | ||
</ApprovalSectionBody> | ||
</ApprovalSection> | ||
<ApprovalSection> | ||
<ApprovalSectionHeader label={t('Network Fee')} /> | ||
<ApprovalSectionBody> | ||
<TxDetailsRow label={t('Fee Amount')}> | ||
<AvaxAmount amount={txFee} avaxPrice={avaxPrice} /> | ||
</TxDetailsRow> | ||
</ApprovalSectionBody> | ||
</ApprovalSection> | ||
</> | ||
); | ||
} |
43 changes: 43 additions & 0 deletions
43
src/pages/ApproveAction/components/ApproveRegisterL1Validator.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,43 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { | ||
ApprovalSection, | ||
ApprovalSectionBody, | ||
ApprovalSectionHeader, | ||
} from '@src/components/common/approval/ApprovalSection'; | ||
import { TxDetailsRow } from '@src/components/common/approval/TxDetailsRow'; | ||
|
||
import { AvaxAmount } from './AvaxAmount'; | ||
import { Avalanche } from '@avalabs/core-wallets-sdk'; | ||
|
||
export function ApproveRegisterL1Validator({ | ||
tx, | ||
avaxPrice, | ||
}: { | ||
tx: Avalanche.RegisterL1ValidatorTx; | ||
avaxPrice: number; | ||
}) { | ||
const { t } = useTranslation(); | ||
const { txFee, balance } = tx; | ||
|
||
return ( | ||
<> | ||
<ApprovalSection sx={{ gap: 1 }}> | ||
<ApprovalSectionHeader label={t('Details')} /> | ||
<ApprovalSectionBody sx={{ justifyContent: 'start', py: 2.25 }}> | ||
<TxDetailsRow label={t('Initial balance')}> | ||
<AvaxAmount amount={balance} avaxPrice={avaxPrice} /> | ||
</TxDetailsRow> | ||
</ApprovalSectionBody> | ||
</ApprovalSection> | ||
<ApprovalSection> | ||
<ApprovalSectionHeader label={t('Network Fee')} /> | ||
<ApprovalSectionBody> | ||
<TxDetailsRow label={t('Fee Amount')}> | ||
<AvaxAmount amount={txFee} avaxPrice={avaxPrice} /> | ||
</TxDetailsRow> | ||
</ApprovalSectionBody> | ||
</ApprovalSection> | ||
</> | ||
); | ||
} |
35 changes: 35 additions & 0 deletions
35
src/pages/ApproveAction/components/ApproveSetL1ValidatorWeight.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,35 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { | ||
ApprovalSection, | ||
ApprovalSectionBody, | ||
ApprovalSectionHeader, | ||
} from '@src/components/common/approval/ApprovalSection'; | ||
import { TxDetailsRow } from '@src/components/common/approval/TxDetailsRow'; | ||
|
||
import { AvaxAmount } from './AvaxAmount'; | ||
import { Avalanche } from '@avalabs/core-wallets-sdk'; | ||
|
||
export function ApproveRegisterL1Validator({ | ||
tx, | ||
avaxPrice, | ||
}: { | ||
tx: Avalanche.SetL1ValidatorWeightTx; | ||
avaxPrice: number; | ||
}) { | ||
const { t } = useTranslation(); | ||
const { txFee } = tx; | ||
|
||
return ( | ||
<> | ||
<ApprovalSection> | ||
<ApprovalSectionHeader label={t('Network Fee')} /> | ||
<ApprovalSectionBody> | ||
<TxDetailsRow label={t('Fee Amount')}> | ||
<AvaxAmount amount={txFee} avaxPrice={avaxPrice} /> | ||
</TxDetailsRow> | ||
</ApprovalSectionBody> | ||
</ApprovalSection> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.