Skip to content

Commit

Permalink
feat(suite): ContractAddressWithTooltip in TokenSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
enjojoy committed Oct 18, 2024
1 parent 6ef290b commit 672f0c8
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions packages/suite/src/views/wallet/send/Outputs/Amount/TokenSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,37 @@ export const buildTokenOptions = (
});
});

if (tokens.hiddenWithBalance.length) {
tokens.hiddenWithBalance.forEach(token => {
result.push({
type: 'currency',
symbol: token.symbol ?? symbol,
networkSymbol: symbol,
hidden: true,
coingeckoId: getCoingeckoId(symbol) ?? '',
contractAddress: token.contract,
cryptoName: token.name,
balance: token.balance,
});
});
}
// Right now we dont want to show hidden or unverified tokens, left for the future use

if (tokens.unverifiedWithBalance.length) {
tokens.unverifiedWithBalance.forEach(token => {
result.push({
type: 'currency',
unverified: true,
symbol: token.symbol ?? symbol,
networkSymbol: symbol,
coingeckoId: getCoingeckoId(symbol) ?? '',
contractAddress: token.contract,
cryptoName: token.name,
balance: token.balance,
});
});
}
// if (tokens.hiddenWithBalance.length) {
// tokens.hiddenWithBalance.forEach(token => {
// result.push({
// type: 'currency',
// symbol: token.symbol ?? symbol,
// networkSymbol: symbol,
// hidden: true,
// coingeckoId: getCoingeckoId(symbol) ?? '',
// contractAddress: token.contract,
// cryptoName: token.name,
// balance: token.balance,
// });
// });
// }

// if (tokens.unverifiedWithBalance.length) {
// tokens.unverifiedWithBalance.forEach(token => {
// result.push({
// type: 'currency',
// unverified: true,
// symbol: token.symbol ?? symbol,
// networkSymbol: symbol,
// coingeckoId: getCoingeckoId(symbol) ?? '',
// contractAddress: token.contract,
// cryptoName: token.name,
// balance: token.balance,
// });
// });
// }
}

return result;
Expand Down Expand Up @@ -272,12 +274,18 @@ export const TokenSelect = ({ outputId }: TokenSelectProps) => {
</Text>
</Row>
<Row justifyContent="flex-start">
{option.contractAddress && (
{option.contractAddress && option.cryptoName && (
<ContractAddressWithTooltip
contractAddress={option.contractAddress}
tooltipTextTypographyStyle="label"
variant="tertiary"
gap={spacings.xxxs}
cryptoName={option.cryptoName}
networkName={
networks[
option.networkSymbol as NetworkSymbol
].name
}
/>
)}
</Row>
Expand Down

0 comments on commit 672f0c8

Please sign in to comment.