Skip to content

Commit

Permalink
Improve handling of nameless ERC-20 tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Jun 14, 2023
1 parent a52155d commit 4cfa0d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changelog/523.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve handling of nameless ERC-20 tokens
3 changes: 2 additions & 1 deletion src/app/components/Account/TokenPills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type PillProps = {
}

export const Pill: FC<PillProps> = ({ account, pill }) => {
const { t } = useTranslation()
const tokenRoute = RouteUtils.getAccountTokensRoute(
account,
account.address_eth ?? account.address,
Expand All @@ -56,7 +57,7 @@ export const Pill: FC<PillProps> = ({ account, pill }) => {
key={pill.token_contract_addr}
label={
<>
<RoundedBalance value={pill.balance} ticker={pill.token_symbol} />
<RoundedBalance value={pill.balance} ticker={pill.token_symbol || t('common.missing')} />
</>
}
sx={{ mr: 2 }}
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/AccountDetailsPage/TokensCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const TokensCard: FC<TokensCardProps> = ({ type }) => {
key: item.token_contract_addr,
data: [
{
content: item.token_name,
content: item.token_name || t('common.missing'),
key: 'name',
},
{
Expand All @@ -68,7 +68,7 @@ export const TokensCard: FC<TokensCardProps> = ({ type }) => {
},
{
align: TableCellAlign.Right,
content: item.token_symbol,
content: item.token_symbol || t('common.missing'),
key: 'ticker',
},
],
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"loadMore": "Load more",
"lessThanAmount": "< {{value}} {{ticker}}",
"logs": "Logs",
"missing": "n/a",
"name": "Name",
"oasis": "Oasis",
"paratime": "Paratime",
Expand Down

0 comments on commit 4cfa0d0

Please sign in to comment.