diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ffdce292..645b613e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Improvements +- [#237](https://github.com/alleslabs/celatone-frontend/pull/237) Change unsupported tokens layout and style - [#234](https://github.com/alleslabs/celatone-frontend/pull/234) Fix faucet wording - [#216](https://github.com/alleslabs/celatone-frontend/pull/216) Change icon to Alles Labs icon set - [#227](https://github.com/alleslabs/celatone-frontend/pull/227) Refactor directory structure and components e.g. various tables diff --git a/src/lib/components/modal/UnsupportedTokensModal.tsx b/src/lib/components/modal/UnsupportedTokensModal.tsx index a7916d12b..f4416497c 100644 --- a/src/lib/components/modal/UnsupportedTokensModal.tsx +++ b/src/lib/components/modal/UnsupportedTokensModal.tsx @@ -10,7 +10,7 @@ import { ModalBody, Button, Heading, - Box, + Tooltip, } from "@chakra-ui/react"; import { useWallet } from "@cosmos-kit/react"; import { useMemo } from "react"; @@ -49,21 +49,46 @@ const UnsupportedToken = ({ balance }: UnsupportedTokenProps) => { return ( - - + + {tokenLabel} - - - + + + + + + {`${tokenType} Token`} @@ -72,7 +97,8 @@ const UnsupportedToken = ({ balance }: UnsupportedTokenProps) => { {formatUTokenWithPrecision( balance.amount as U, - balance.precision + balance.precision, + false )} @@ -124,7 +150,7 @@ export const UnsupportedTokensModal = ({ - + diff --git a/src/lib/utils/formatter/token.ts b/src/lib/utils/formatter/token.ts index 18be35149..97d37e74f 100644 --- a/src/lib/utils/formatter/token.ts +++ b/src/lib/utils/formatter/token.ts @@ -40,15 +40,16 @@ export const toToken = ( /** * @remarks - * If token is more than or equal to 1 billion, should add postfix M and format to 2 decimal point + * If token is more than or equal to 1 billion, should add suffix B and format to 2 decimal point * */ export const formatUTokenWithPrecision = ( amount: U>, - precision: number + precision: number, + isSuffix = true ): string => { const token = toToken(amount, precision); - if (token.gte(B)) { + if (isSuffix && token.gte(B)) { return `${formatDemimal({ decimalPoints: 2, delimiter: true })( token.div(B), "0.00"