Skip to content
Open
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
52 changes: 51 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion src/apps/popup/pages/token-details/token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
import { useFetchCep18Tokens } from '@libs/services/cep18-service';
import {
Button,
Hash,
HashVariant,
List,
SvgIcon,
TokenPlate,
Expand Down Expand Up @@ -94,10 +96,26 @@ export const Token = () => {
return [
{ id: 1, name: 'Symbol', value: token?.symbol ?? '' },
{ id: 2, name: 'Decimals', value: (token?.decimals || 0).toString() },
...(Boolean(Number(token?.tokenPrice)) && token
...(token?.contractPackageHash
? [
{
id: 3,
name: 'Contract package hash',
value: (
<Hash
value={token.contractPackageHash}
variant={HashVariant.CaptionHash}
truncated
color="contentPrimary"
/>
)
}
]
: []),
...(Boolean(Number(token?.tokenPrice)) && token
? [
{
id: 4,
name: 'Market Price',
value: <MarketDataValue token={token} />
}
Expand Down
22 changes: 15 additions & 7 deletions src/libs/ui/components/token-plate/token-plate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
getSpacingSize
} from '@libs/layout';
import { SvgIcon, Tooltip, Typography } from '@libs/ui/components';
import { truncateKey } from '@libs/ui/components/hash/utils';

const TokenAmountContainer = styled(FlexColumn)`
max-width: 300px;
Expand Down Expand Up @@ -52,6 +53,19 @@ export const TokenPlate = ({
const tokenIconFormat = token?.icon?.split('.').pop()?.toLowerCase();
const isTokenIconSvg = tokenIconFormat === 'svg';

const nameTooltipTitle = token?.contractPackageHash ? (
<FlexColumn gap={SpacingSize.Tiny}>
<Typography type="captionRegular" overflowWrap>
{token.name}
</Typography>
<Typography type="captionHash" color="contentSecondary">
{truncateKey(token.contractPackageHash, { size: 'base' })}
</Typography>
</FlexColumn>
) : token?.name && token.name.length > 10 ? (
token.name
) : undefined;

return (
<ListItemContainer
chevron={chevron}
Expand All @@ -71,13 +85,7 @@ export const TokenPlate = ({
)}
<FlexColumn>
<TokenNameContainer>
<Tooltip
title={
token?.name && token.name.length > 10 ? token.name : undefined
}
fullWidth
overflowWrap
>
<Tooltip title={nameTooltipTitle} fullWidth overflowWrap>
<Typography type="bodySemiBold" ellipsis loading={!token?.name}>
{token?.name}
</Typography>
Expand Down
Loading