Skip to content

Commit 650e7fe

Browse files
matusbalascaktomasklim
authored andcommitted
fix(suite): show correct signValue prefix for cardano deposit amount
1 parent ca4f84a commit 650e7fe

File tree

1 file changed

+14
-1
lines changed
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails

1 file changed

+14
-1
lines changed

packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AmountDetails.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ export const AmountDetails = ({ tx, isTestnet }: AmountDetailsProps) => {
5151
const isStakeType = isStakeTypeTx(txSignature) || tx?.solanaSpecific?.stakeOperation?.type; // ethereum or solana staking tx
5252
const isStakeTypeTxNoAmount = isStakeType && amount.eq(0);
5353

54+
const getCardanoStakingSignValue = () => {
55+
const subtype = tx.cardanoSpecific?.subtype;
56+
57+
switch (subtype) {
58+
case 'stake_registration':
59+
return 'negative';
60+
case 'stake_deregistration':
61+
return 'positive';
62+
}
63+
64+
return 'positive';
65+
};
66+
5467
const getAmountSignValue = () => {
5568
const txOp = getTxOperation(tx.type, true);
5669

@@ -288,7 +301,7 @@ export const AmountDetails = ({ tx, isTestnet }: AmountDetailsProps) => {
288301
<FormattedCryptoAmount
289302
value={cardanoDeposit}
290303
symbol={tx.symbol}
291-
signValue="positive"
304+
signValue={getCardanoStakingSignValue()}
292305
/>
293306
</Text>
294307
</Table.Cell>

0 commit comments

Comments
 (0)