diff --git a/components/AccountOverview/styles.module.scss b/components/AccountOverview/styles.module.scss index d3b187274..4f154f0fc 100644 --- a/components/AccountOverview/styles.module.scss +++ b/components/AccountOverview/styles.module.scss @@ -35,6 +35,10 @@ .balance { text-transform: none; + b, + span { + font-weight: 400 !important; + } } @media screen and (max-width: 1024px) { diff --git a/components/AssetList/index.tsx b/components/AssetList/index.tsx index a5143597d..d16eba3a7 100644 --- a/components/AssetList/index.tsx +++ b/components/AssetList/index.tsx @@ -4,8 +4,9 @@ import { gql } from 'graphql-request' import BigNumber from 'bignumber.js' import Table from 'components/Table' import TokenLogo from 'components/TokenLogo' -import { parseTokenName, client, GraphQLSchema } from 'utils' +import Amount from 'components/Amount' import NoDataIcon from 'assets/icons/no-data.svg' +import { parseTokenName, client, GraphQLSchema } from 'utils' import styles from './styles.module.scss' export type UdtList = Array<{ @@ -57,10 +58,6 @@ const AssetList = ({ list = [] }: { list: UdtList }) => { {list.length ? ( list.map(item => { - const [amountInt, amountFrac] = new BigNumber(item.value ?? '0') - .dividedBy(10 ** (item.udt.decimal ?? 0)) - .toFormat() - .split('.') return ( @@ -79,11 +76,7 @@ const AssetList = ({ list = [] }: { list: UdtList }) => { {t(item.udt.type === GraphQLSchema.UdtType.Native ? 'native' : 'bridged')} -
- {amountInt} - {amountFrac ? {`.${amountFrac}`} : null} -
- {item.udt.symbol ?? ''} + ) diff --git a/components/RoundedAmount.tsx b/components/RoundedAmount.tsx index ec29ddf37..a03a79599 100644 --- a/components/RoundedAmount.tsx +++ b/components/RoundedAmount.tsx @@ -11,7 +11,7 @@ const RoundedAmount: React.FC<{ amount: string; udt: { decimal: number; symbol: const isExact = new BigNumber(roundedAmount).isEqualTo(a) return ( - + {`${isExact ? '' : '≈ '}`} {new BigNumber(rInt).toFormat()} {rFrac ? {`.${rFrac}`} : null} diff --git a/pages/token/styles.module.scss b/pages/token/styles.module.scss index 37dffaa3c..7be32974b 100644 --- a/pages/token/styles.module.scss +++ b/pages/token/styles.module.scss @@ -42,6 +42,10 @@ } dd { text-transform: none; + span, + b { + font-weight: 400 !important; + } } } diff --git a/pages/tx/[hash].tsx b/pages/tx/[hash].tsx index cbff8cc17..9f8e98487 100644 --- a/pages/tx/[hash].tsx +++ b/pages/tx/[hash].tsx @@ -142,7 +142,7 @@ const Tx = () => { ) : tx ? ( ) : ( - '-' + t('pending') ), }, { @@ -152,7 +152,7 @@ const Tx = () => { ) : tx ? ( ) : ( - '-' + t('pending') ), }, tx?.contractAddress?.length === ADDR_LENGTH @@ -164,10 +164,12 @@ const Tx = () => { { field: t('value'), // FIXME: tx.value is formatted incorrectly - content: ( + content: tx?.value ? (
- +
+ ) : ( + t('pending') ), }, tx?.input @@ -220,7 +222,7 @@ const Tx = () => { t('pending') ), }, - { field: t('index'), content: tx?.index ?? '-' }, + { field: t('index'), content: tx?.index ?? t('pending') }, { field: t('nonce'), content: tx ? (tx.nonce || 0).toLocaleString('en') : }, { field: t('status'), @@ -228,44 +230,42 @@ const Tx = () => { }, { field: t('gasPrice'), - content: - tx && tx.gasPrice !== null ? ( - {`${new BigNumber(tx.gasPrice).toFormat()} ${PCKB_UDT_INFO.symbol}`} - ) : isTxLoading ? ( - - ) : ( - '-' - ), + content: tx?.gasPrice ? ( + {`${new BigNumber(tx.gasPrice).toFormat()} ${PCKB_UDT_INFO.symbol}`} + ) : isTxLoading ? ( + + ) : ( + t('pending') + ), }, { field: t('gasUsed'), content: - tx && tx.gasUsed !== null && tx.polyjuiceStatus !== 'pending' ? ( + tx && tx.gasUsed ? ( new BigNumber(tx.gasUsed).toFormat() ) : isTxLoading ? ( ) : ( - '-' + t('pending') ), }, { field: t('gasLimit'), - content: - tx && tx.gasLimit !== null ? ( - new BigNumber(tx.gasLimit).toFormat() - ) : isTxLoading ? ( - - ) : ( - '-' - ), + content: tx?.gasLimit ? ( + new BigNumber(tx.gasLimit).toFormat() + ) : isTxLoading ? ( + + ) : ( + t('pending') + ), }, { field: t('fee'), content: - tx && tx.gasPrice !== null && typeof tx.gasUsed !== null && tx.polyjuiceStatus !== 'pending' ? ( + tx && tx.gasPrice && tx.gasUsed ? ( @@ -273,7 +273,7 @@ const Tx = () => { ) : isTxLoading ? ( ) : ( - '-' + t('pending') ), }, { diff --git a/pages/tx/styles.module.scss b/pages/tx/styles.module.scss index 005a04b70..4f06bf5df 100644 --- a/pages/tx/styles.module.scss +++ b/pages/tx/styles.module.scss @@ -30,6 +30,11 @@ .gasPrice, .gasFee { text-transform: none; + + b, + span { + font-weight: 400 !important; + } } a {