From 257a5eef3b0287a5ac1f3841b615b0d92c508480 Mon Sep 17 00:00:00 2001 From: Tatis Date: Mon, 10 Jan 2022 07:40:17 -0600 Subject: [PATCH] Update styles and semantics for listed for per feedback (#660) --- .../src/components/SpotlightItem.js | 48 +++++++++++---- apps/next-react/src/components/TokenCard.js | 61 +++++++------------ .../src/components/TokenDetailBody.js | 46 +++++++++----- 3 files changed, 89 insertions(+), 66 deletions(-) diff --git a/apps/next-react/src/components/SpotlightItem.js b/apps/next-react/src/components/SpotlightItem.js index 192ac9f908..1976e27492 100644 --- a/apps/next-react/src/components/SpotlightItem.js +++ b/apps/next-react/src/components/SpotlightItem.js @@ -120,6 +120,9 @@ const SpotlightItem = ({ myProfile?.profile_id === thisItem?.listing?.profile_id && typeof myProfile?.profile_id === "number"; + const freeItem = item?.listing?.min_price === 0; + const singleEdition = item?.listing?.total_edition_quantity === 1; + return ( <> {typeof document !== "undefined" ? ( @@ -510,8 +513,9 @@ const SpotlightItem = ({ {item.listing && (

- {item.listing.total_edition_quantity} Editions /{" "} - {parseInt(item.listing.royalty_percentage)}% Royalties + {singleEdition + ? `${item.listing.total_edition_quantity} Edition` + : `${item.listing.total_edition_quantity} Editions`}

)} @@ -601,16 +605,36 @@ const SpotlightItem = ({
{item.listing ? ( - + <> + {ifListedIsOwner ? ( +

+ {freeItem ? ( + "Listed for Free" + ) : ( + <> + {`Price ${item.listing.min_price} ${item.listing.currency}`} + + )} +

+ ) : ( + + )} + ) : (
@@ -737,34 +729,21 @@ const TokenCard = ({
- {ifListedIsOwner ? ( -
-
- - Listed for - -

- {parseFloat(item.listing.min_price)} $ +

+

+ Price +

+

+ {freeListedItem ? ( + "Free" + ) : ( + <> + {parseFloat(item.listing.min_price)}{" "} {item.listing.currency} -

-
-
- ) : ( - - )} + + )} +

+
) : item.owner_count && item.owner_count > 1 ? ( pageProfile && listId === 2 ? ( @@ -872,7 +851,9 @@ const TokenCard = ({

- {item.token_count ? `${item.token_count} Editions` : "1/1"} + {singleItem || !item.token_count + ? "1 Edition" + : `${item.token_count} Editions`}

diff --git a/apps/next-react/src/components/TokenDetailBody.js b/apps/next-react/src/components/TokenDetailBody.js index 6a2968f8a1..548b6b60cc 100644 --- a/apps/next-react/src/components/TokenDetailBody.js +++ b/apps/next-react/src/components/TokenDetailBody.js @@ -154,10 +154,13 @@ const TokenDetailBody = ({ const isOwnedByUser = typeof myProfile?.profile_id === "number" && myProfile?.profile_id === item?.owner_id; + const ifListedIsOwner = myProfile?.profile_id === item?.listing?.profile_id && typeof myProfile?.profile_id === "number"; + const freeItem = item?.listing?.min_price === 0; + return ( <> {typeof document !== "undefined" ? ( @@ -626,20 +629,35 @@ const TokenDetailBody = ({ {item.listing ? ( - + <> + {ifListedIsOwner ? ( +

+ {freeItem ? ( + "Listed for Free" + ) : ( + <> + {`Price ${item.listing.min_price} ${item.listing.currency}`} + + )} +

+ ) : ( + + )} + ) : isOwnedByUser && SHOWTIME_CONTRACTS.includes(item.contract_address) ? (