1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

UX Improvement: Fixed tooltip for token-list-item (#20258)

* updated tooltip for token-list-item

* updated snapshot
This commit is contained in:
Nidhi Kumari 2023-08-02 15:07:12 +05:30 committed by GitHub
parent 446c7bb3fe
commit ad919026ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 28 deletions

View File

@ -42,13 +42,6 @@ exports[`Token Cell should match snapshot 1`] = `
>
<div
class="mm-box mm-box--width-1/3"
>
<div>
<div
class=""
style="display: inline;"
tabindex="0"
title=""
>
<p
class="mm-box mm-text mm-text--body-md mm-text--font-weight-medium mm-text--ellipsis mm-box--color-text-default"
@ -56,8 +49,6 @@ exports[`Token Cell should match snapshot 1`] = `
TEST
</p>
</div>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-text--font-weight-medium mm-text--text-align-end mm-box--width-2/3 mm-box--color-text-default"
/>

View File

@ -43,12 +43,10 @@ exports[`TokenListItem should render correctly 1`] = `
<div
class="mm-box mm-box--width-1/3"
>
<div>
<p
class="mm-box mm-text mm-text--body-md mm-text--font-weight-medium mm-text--ellipsis mm-box--color-text-default"
/>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-text--font-weight-medium mm-text--text-align-end mm-box--width-2/3 mm-box--color-text-default"
/>

View File

@ -48,6 +48,7 @@ export const TokenListItem = ({
const primaryTokenImage = useSelector(getNativeCurrencyImage);
const trackEvent = useContext(MetaMetricsContext);
const chainId = useSelector(getCurrentChainId);
const tokenTitle = title === 'ETH' ? t('networkNameEthereum') : title;
// Used for badge icon
const currentNetwork = useSelector(getCurrentNetwork);
@ -121,11 +122,11 @@ export const TokenListItem = ({
gap={1}
>
<Box width={BlockSize.OneThird}>
{title?.length > 12 ? (
<Tooltip
position="bottom"
interactive
html={title}
disabled={title?.length < 12}
tooltipInnerClassName="multichain-token-list-item__tooltip"
>
<Text
@ -133,9 +134,18 @@ export const TokenListItem = ({
variant={TextVariant.bodyMd}
ellipsis
>
{title === 'ETH' ? t('networkNameEthereum') : title}
{tokenTitle}
</Text>
</Tooltip>
) : (
<Text
fontWeight={FontWeight.Medium}
variant={TextVariant.bodyMd}
ellipsis
>
{tokenTitle}
</Text>
)}
</Box>
<Text
fontWeight={FontWeight.Medium}