Skip to content

Commit

Permalink
fix: set allowNegative=false to fix warnings for number format (#106)
Browse files Browse the repository at this point in the history
* fix: set allowNegative=false to fix warnings for number format

* fix: styling of stx tx transaction history
  • Loading branch information
teebszet committed Mar 5, 2024
1 parent f866f86 commit 8315632
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/app/components/transactions/transactionAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function TransactionAmount(props: TransactionAmountProps): JSX.El
displayType="text"
thousandSeparator
prefix={prefix}
allowNegative={false}
renderText={(value: string) => (
<TransactionValue>{`${value} ${currency}`}</TransactionValue>
)}
Expand All @@ -55,6 +56,7 @@ export default function TransactionAmount(props: TransactionAmountProps): JSX.El
displayType="text"
thousandSeparator
prefix={prefix}
allowNegative={false}
renderText={(value: string) => (
<TransactionValue>{`${value} ${getFtTicker(
token as FungibleToken,
Expand All @@ -76,10 +78,9 @@ export default function TransactionAmount(props: TransactionAmountProps): JSX.El
value={satsToBtc(BigNumber(btcTransaction.amount)).toString()}
displayType="text"
thousandSeparator
prefix=""
renderText={(value: string) => (
<TransactionValue>{`${prefix}${value} BTC`}</TransactionValue>
)}
prefix={prefix}
allowNegative={false}
renderText={(value: string) => <TransactionValue>{`${value} BTC`}</TransactionValue>}
/>
);
}
Expand All @@ -92,9 +93,10 @@ export default function TransactionAmount(props: TransactionAmountProps): JSX.El
value={BigNumber(brc20Transaction.amount).toString()}
displayType="text"
thousandSeparator
prefix=""
prefix={prefix}
allowNegative={false}
renderText={(value: string) => (
<TransactionValue>{`${prefix}${value} ${brc20Transaction.ticker.toUpperCase()}`}</TransactionValue>
<TransactionValue>{`${value} ${brc20Transaction.ticker.toUpperCase()}`}</TransactionValue>
)}
/>
);
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/transactions/txTransfers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const RecipientAddress = styled.p((props) => ({
}));

const TransactionValue = styled.p((props) => ({
...props.theme.typography.body_s,
...props.theme.typography.body_medium_m,
color: props.theme.colors.white_0,
}));

Expand Down Expand Up @@ -102,6 +102,7 @@ export default function TxTransfers(props: TxTransfersProps) {
}
displayType="text"
thousandSeparator
allowNegative={false}
prefix={isSentTransaction ? '-' : ''}
renderText={(value: string) => (
<TransactionValue>
Expand Down

0 comments on commit 8315632

Please sign in to comment.