Skip to content

Commit 4836445

Browse files
committed
feat: support TokenAmount details tooltip [LW-11733]
1 parent 456d99d commit 4836445

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/design-system/assets-table/assets-table-token-amount.component.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import { Flex } from '../flex';
44
import { Text } from '../text';
55
import { FontWeights } from '../text/create-text.util';
6+
import { Tooltip } from '../tooltip';
67

78
import * as cx from './assets-table-token-amount.css';
89

@@ -13,21 +14,27 @@ interface Props {
1314
details: string;
1415
detailsColor?: TypographyVariants['color'];
1516
detailsWeight?: FontWeights;
17+
detailsTooltip?: string;
1618
}
1719

1820
export const TokenAmount = ({
1921
amount,
2022
details,
2123
detailsColor = 'secondary',
2224
detailsWeight = '$regular',
25+
detailsTooltip,
2326
}: Readonly<Props>): JSX.Element => {
2427
return (
2528
<Flex flexDirection="column" alignItems="flex-end" className={cx.container}>
2629
<Text.Body.Large weight="$semibold" data-testid="token-amount">
2730
{amount}
2831
</Text.Body.Large>
2932
<Text.Body.Normal color={detailsColor} weight={detailsWeight}>
30-
{details}
33+
{detailsTooltip ? (
34+
<Tooltip label={detailsTooltip}>{details}</Tooltip>
35+
) : (
36+
details
37+
)}
3138
</Text.Body.Normal>
3239
</Flex>
3340
);

src/design-system/assets-table/assets-table.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const PendingAssetInfo = ({ id }: Readonly<AssetInfoProps>): JSX.Element => (
6868
amount="21,584.48"
6969
details="+ 5 pending"
7070
detailsColor="success"
71+
detailsTooltip="Pending coins represent tokens that the wallet recognizes but are not yet finalized by the network. These coins are currently unspendable until confirmed."
7172
/>
7273
</AssetsTable>
7374
);

0 commit comments

Comments
 (0)