Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round token supply number in token list #703

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/703.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Round token supply number in token list
3 changes: 2 additions & 1 deletion src/app/components/Tokens/TokenList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { FC } from 'react'
import Typography from '@mui/material/Typography'
import { COLORS } from '../../../styles/theme/colors'
import { SxProps } from '@mui/material/styles'
import { RoundedBalance } from '../RoundedBalance'

type TokensProps = {
tokens?: EvmToken[]
Expand Down Expand Up @@ -129,7 +130,7 @@ export const TokenList = (props: TokensProps) => {
align: TableCellAlign.Right,
},
{
content: token.total_supply,
content: <RoundedBalance value={token.total_supply} ticker={token.symbol} />,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I prefer this way of formatting the supply: https://github.com/oasisprotocol/explorer/blob/master/src/locales/en/translation.json#L215

With rounded balance:
image

Via i18next:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I also understand that it is not great with decimals.
I think we need a way that satisfies both criteria.

Can we have the same grouping in RoundedBalance?

(Also, maybe we could consider to resurrect #333?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at task for now we care about decimals only. Prob Don will revisit it all later. i18n does not match logic in RoundedDecimals.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think we are good here. As discussed during meeting, RoundedBalance logic will be adjusted in another PR.

key: 'supply',
align: TableCellAlign.Right,
},
Expand Down