From 4ad281c8063c469857ea5293e83a8d37918ac86a Mon Sep 17 00:00:00 2001 From: Harsh Shukla <125105825+PrgrmrHarshShukla@users.noreply.github.com> Date: Mon, 8 May 2023 19:52:33 +0530 Subject: [PATCH] Part of #17670 & #18714: Replace Typography with Text component: nft-details.js (#18771) * Update nft-details.js * Update nft-details.test.js.snap * Update nft-details.js * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update ui/components/app/nft-details/nft-details.js Co-authored-by: George Marshall * Update nft-details.test.js.snap --------- Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> Co-authored-by: Brad Decker Co-authored-by: George Marshall Co-authored-by: George Marshall --- .../__snapshots__/nft-details.test.js.snap | 22 +- ui/components/app/nft-details/nft-details.js | 191 ++++++++---------- 2 files changed, 100 insertions(+), 113 deletions(-) diff --git a/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap b/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap index b66a360ac..6dc2d4854 100644 --- a/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap +++ b/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap @@ -56,12 +56,12 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` >

MUNK #1

# 1 @@ -88,7 +88,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` class="box box--display-flex box--flex-direction-row" >
@@ -96,7 +96,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` class="box nft-details__contract-wrapper box--display-flex box--flex-direction-row" >
1/18/2023
@@ -106,7 +106,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` class="box box--display-flex box--flex-direction-row" > @@ -114,7 +114,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` class="box nft-details__contract-wrapper box--display-flex box--flex-direction-row" >
0.0049 ETH
@@ -124,12 +124,12 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` class="box box--display-flex box--flex-direction-row" >
@@ -153,7 +153,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` class="box nft-details__contract-wrapper box--display-flex box--flex-direction-row" >
0xDc7...6414
@@ -183,7 +183,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = `
Disclaimer: MetaMask pulls the media file from the source url. This url sometimes is changed by the marketplace the NFT was minted on.
diff --git a/ui/components/app/nft-details/nft-details.js b/ui/components/app/nft-details/nft-details.js index 336d5a96c..bbdd1df12 100644 --- a/ui/components/app/nft-details/nft-details.js +++ b/ui/components/app/nft-details/nft-details.js @@ -5,15 +5,14 @@ import { useHistory } from 'react-router-dom'; import { isEqual } from 'lodash'; import Box from '../../ui/box'; import Card from '../../ui/card'; -import Typography from '../../ui/typography/typography'; import { TextColor, IconColor, - TypographyVariant, - FONT_WEIGHT, + TextVariant, + FontWeight, JustifyContent, FLEX_DIRECTION, - OVERFLOW_WRAP, + OverflowWrap, DISPLAY, BLOCK_SIZES, } from '../../../helpers/constants/design-system'; @@ -53,7 +52,7 @@ import { TokenStandard, } from '../../../../shared/constants/transaction'; import NftDefaultImage from '../nft-default-image'; -import { ButtonIcon, IconName } from '../../component-library'; +import { ButtonIcon, IconName, Text } from '../../component-library'; import Tooltip from '../../ui/tooltip'; import { decWEIToDecETH } from '../../../../shared/modules/conversion.utils'; @@ -201,42 +200,45 @@ export default function NftDetails({ nft }) { justifyContent={JustifyContent.spaceBetween} >
- {name} - - + #{tokenId} - +
{description ? (
- {t('description')} - - + {description} - +
) : null} {inPopUp ? null : renderSendButton()} @@ -246,87 +248,78 @@ export default function NftDetails({ nft }) { {lastSale ? ( <> - {t('lastSold')} - + - {formattedTimestamp} - + - {t('lastPriceSold')} - + - {`${Number(decWEIToDecETH(lastSale.total_price))} ${ lastSale.payment_token.symbol }`} - + ) : null} - {t('source')} - - + )} - + {imageThumbnail ? ( - {t('link')} - - + {imageThumbnail}
- + ) : null} - {t('contractAddress')} - + - {shortenAddress(address)} - + {inPopUp ? renderSendButton() : null} - {t('nftDisclaimer')} - +