Skip to content

Commit

Permalink
fix: format tx value amount in txlist
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendn committed Jul 18, 2023
1 parent 0868f4c commit 9a7504d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"license": "MIT",
"dependencies": {
"@astradefi/address-converter": "^0.4.1",
"@astraprotocol/astra-ui": "1.0.39",
"@astraprotocol/astra-ui": "1.0.45",
"@cosmjs/crypto": "^0.29.0",
"@cosmjs/encoding": "^0.29.0",
"@reduxjs/toolkit": "^1.8.5",
Expand Down
6 changes: 4 additions & 2 deletions views/transactions/TransactionRowContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Typography from 'components/Typography'
import Image from 'next/image'
import { CONFIG } from 'utils/constants'
import { evmAddressName, isEvmTransactionType } from 'utils/evm'
import { convertBalanceToView, ellipseBetweenText, ellipseRightText, LinkMaker } from 'utils/helper'
import { LinkMaker, convertBalanceToView, ellipseBetweenText, ellipseRightText } from 'utils/helper'
import styles from './style.module.scss'

export type TransactionRowContentProps = {
Expand Down Expand Up @@ -60,6 +60,7 @@ export default function TransactionRowContent({
const statusText = status ? 'success' : 'error'
const isEvm = isEvmTransactionType(type)
const addressQuery = hash?.startsWith('0x') ? '' : isEvm ? { type: 'evm' } : ''

return (
<>
<div
Expand Down Expand Up @@ -154,7 +155,8 @@ export default function TransactionRowContent({
<>
<TypographyLib.Balance
size="sm"
value={value}
value={parseFloat(value || '0').toPrecision(4)}
// value={value}
currency={
valueCurrency
? valueCurrency.toUpperCase()
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
link-module-alias "^1.2.0"
shx "^0.3.4"

"@astraprotocol/[email protected].39":
version "1.0.39"
resolved "https://npm.pkg.github.com/download/@astraprotocol/astra-ui/1.0.39/69c8c0faae5160a10d3fd72ff9691b2d7ce82f12#69c8c0faae5160a10d3fd72ff9691b2d7ce82f12"
integrity sha512-Zze/t21N7GAInwSzwLDhk5QgtLMX/+zfv5JTrdrKNaDHHHpTlnlA8BXfOfV+qUV7s+W1DqCwUuJ5YeFS4bxjIg==
"@astraprotocol/[email protected].45":
version "1.0.45"
resolved "https://npm.pkg.github.com/download/@astraprotocol/astra-ui/1.0.45/7d515ce4398973dba440447b8dfe15d6df446718#7d515ce4398973dba440447b8dfe15d6df446718"
integrity sha512-vicsVmiJPBVjqfY80yrJv5JVW6SAGztkwxZ/ZTGsGlSA7bdOJoijeuxlaG8m/TVf0Fh+msXAWwembChErJQsNw==
dependencies:
"@types/numeral" "^2.0.2"
"@types/react-copy-to-clipboard" "^5.0.4"
Expand Down

0 comments on commit 9a7504d

Please sign in to comment.