Skip to content

Commit 9563991

Browse files
authored
fix: approval screens for CreateChainTx + ConvertSubnetToL1 (#296)
1 parent 25140d4 commit 9563991

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

apps/legacy/src/localization/locales/en/translation.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@
541541
"Manage Collectibles": "Manage Collectibles",
542542
"Manage Networks": "Manage Networks",
543543
"Manage Tokens": "Manage Tokens",
544-
"Manager Address": "Manager Address",
545544
"Manually Create New Wallet": "Manually Create New Wallet",
546545
"Market News": "Market News",
547546
"Max Base Fee": "Max Base Fee",
@@ -887,8 +886,8 @@
887886
"Spendable Balance": "Spendable Balance",
888887
"Spender": "Spender",
889888
"Spending limit": "Spending limit",
890-
"Stake": "Stake",
891889
"Stake Amount": "Stake Amount",
890+
"Stake Weight": "Stake Weight",
892891
"Staked": "Staked",
893892
"Staking Details": "Staking Details",
894893
"Start": "Start",
@@ -1088,6 +1087,7 @@
10881087
"User rejected the request": "User rejected the request",
10891088
"Users may not use the Bridge if they are on the Specially Designated Nationals (SDN) List of the Office of Foreign Assets Control (OFAC) or any other sanctions or are otherwise a sanctioned person or from a sanctioned jurisdiction": "Users may not use the Bridge if they are on the Specially Designated Nationals (SDN) List of the Office of Foreign Assets Control (OFAC) or any other sanctions or are otherwise a sanctioned person or from a sanctioned jurisdiction",
10901089
"Validation ID": "Validation ID",
1090+
"Validator Manager": "Validator Manager",
10911091
"Validators": "Validators",
10921092
"Value": "Value",
10931093
"Verify": "Verify",

apps/legacy/src/pages/ApproveAction/components/ApproveConvertSubnetToL1.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ export function ApproveConvertSubnetToL1({
3030
<TxDetailsRow label={t('Subnet ID')}>
3131
<TruncatedIdentifier identifier={subnetID} size={14} />
3232
</TxDetailsRow>
33-
<TxDetailsRow label={t('Chain ID')}>
33+
</ApprovalSectionBody>
34+
</ApprovalSection>
35+
<ApprovalSection sx={{ gap: 1 }}>
36+
<ApprovalSectionHeader label={t('Validator Manager')} />
37+
<ApprovalSectionBody sx={{ justifyContent: 'start', py: 2.25 }}>
38+
<TxDetailsRow label={t('Blockchain ID')}>
3439
<TruncatedIdentifier identifier={chainID} size={14} />
3540
</TxDetailsRow>
36-
<TxDetailsRow label={t('Manager Address')}>
41+
<TxDetailsRow label={t('Address')}>
3742
<TruncatedIdentifier identifier={managerAddress} size={14} />
3843
</TxDetailsRow>
3944
</ApprovalSectionBody>
@@ -59,8 +64,8 @@ export function ApproveConvertSubnetToL1({
5964
<TxDetailsRow label={t('Balance')}>
6065
<AvaxAmount amount={balance} avaxPrice={avaxPrice} />
6166
</TxDetailsRow>
62-
<TxDetailsRow label={t('Stake')}>
63-
<AvaxAmount amount={stake} avaxPrice={avaxPrice} />
67+
<TxDetailsRow label={t('Stake Weight')}>
68+
<Typography variant="body2">{String(stake)}</Typography>
6469
</TxDetailsRow>
6570
<Stack sx={{ gap: 1, mb: 2 }}>
6671
<Typography variant="caption" color="text.secondary">

apps/legacy/src/pages/ApproveAction/components/ApproveCreateChain.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function ApproveCreateChain({
2222
avaxPrice: number;
2323
}) {
2424
const { t } = useTranslation();
25-
const { chainID, chainName, vmID, genesisData, txFee } = tx;
25+
const { subnetID, chainName, vmID, genesisData, txFee } = tx;
2626

2727
const [isGenesisFileShown, setIsGenesisFileShown] = useState(false);
2828

@@ -37,11 +37,14 @@ export function ApproveCreateChain({
3737
<ApprovalSection sx={{ gap: 1 }}>
3838
<ApprovalSectionHeader label={t('Blockchain Details')} />
3939
<ApprovalSectionBody sx={{ justifyContent: 'start', py: 2.25 }}>
40+
<TxDetailsRow label={t('Subnet ID')}>
41+
<TruncatedIdentifier identifier={subnetID} />
42+
</TxDetailsRow>
4043
<TxDetailsRow label={t('Blockchain Name')}>
4144
<Typography variant="caption">{chainName}</Typography>
4245
</TxDetailsRow>
43-
<TxDetailsRow label={t('Blockchain ID')}>
44-
<TruncatedIdentifier identifier={chainID} />
46+
<TxDetailsRow label={t('Virtual Machine ID')}>
47+
<TruncatedIdentifier identifier={vmID} />
4548
</TxDetailsRow>
4649
<TxDetailsRow label={t('Genesis File')}>
4750
<Button
@@ -52,9 +55,6 @@ export function ApproveCreateChain({
5255
{t('View')}
5356
</Button>
5457
</TxDetailsRow>
55-
<TxDetailsRow label={t('Virtual Machine ID')}>
56-
<TruncatedIdentifier identifier={vmID} />
57-
</TxDetailsRow>
5858
</ApprovalSectionBody>
5959
</ApprovalSection>
6060
<ApprovalSection>

apps/legacy/src/pages/ApproveAction/components/BlockchainGenesisFile.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ export const BlockchainGenesisFile = ({ onClose, data }) => {
4949
<ApprovalSectionBody sx={{ flexGrow: 1 }}>
5050
<Scrollbars>
5151
<Typography component="pre" variant="caption" monospace>
52-
{data}
52+
{(() => {
53+
try {
54+
const parsed = JSON.parse(data);
55+
return JSON.stringify(parsed, null, 2);
56+
} catch {
57+
return data;
58+
}
59+
})()}
5360
</Typography>
5461
</Scrollbars>
5562
</ApprovalSectionBody>

0 commit comments

Comments
 (0)