From ad85d11a8223a589803995c441125953e84d5573 Mon Sep 17 00:00:00 2001 From: nguyenlejoe Date: Wed, 13 Dec 2023 15:06:03 -0800 Subject: [PATCH] skeleton load --- .../NFTFloorPriceView/NFTFloorPriceView.tsx | 2 +- .../NFTSalesCountView/NFTSalesCountView.tsx | 4 +- .../NFTs/NFTDetailView/NFTDetailView.tsx | 133 +++++++++++------- 3 files changed, 84 insertions(+), 55 deletions(-) diff --git a/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.tsx b/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.tsx index c8d9f816..a993b234 100644 --- a/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.tsx +++ b/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.tsx @@ -104,7 +104,7 @@ export const NFTFloorPriceView: React.FC = ({ }); return ( -
+
Floor Price
diff --git a/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.tsx b/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.tsx index 6cdf2a5f..77f753dd 100644 --- a/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.tsx +++ b/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.tsx @@ -56,7 +56,7 @@ export const NFTSalesCountView: React.FC = ({ return (
= ({ }); return ( -
+
Sales History
diff --git a/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.tsx b/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.tsx index 64355352..625bec97 100644 --- a/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.tsx +++ b/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.tsx @@ -6,6 +6,8 @@ import { type Option, Some, None } from "@/utils/option"; import { type NFTDetailViewProps } from "@/utils/types/organisms.types"; import { type NftTokenContract } from "@covalenthq/client-sdk"; import { useEffect, useState } from "react"; +import { Skeleton } from "@/components/ui/skeleton"; +import { GRK_SIZES } from "@/utils/constants/shared.constants"; export const NFTDetailView: React.FC = ({ chain_name, @@ -28,64 +30,91 @@ export const NFTDetailView: React.FC = ({ })(); }, [chain_name, collection_address, token_id]); - return maybeResult.match({ - None: () =>
Loading...
, - Some: (result) => { - return ( -
- - {result.contract_name} # - {result.nft_data.token_id?.toString()}{" "} - -
-
- + return ( +
-
- Attributes + {maybeResult.match({ + None: () =>
+ +
, + Some: (result) => { + return + {result.contract_name} # + {result.nft_data.token_id?.toString()}{" "} + + }, + })} -
- {result.nft_data.external_data?.attributes.map( - (attrs, i) => { - return ( -
-

- {attrs.trait_type} -

-

{attrs.value}

-
- ); - } - )} -
-
+ +
+ {maybeResult.match({ + None: () =>
+
+ +
+ Attributes + +
+ {[1, 2, 3, 4, 5, 6, 7, 8].map((o, i) => { + return ( + + ); + })}
-
-
- -
-
- +
+
, + Some: (result) => { + return
+ + +
+ Attributes + +
+ {result.nft_data.external_data?.attributes.map( + (attrs, i) => { + return ( +
+

+ {attrs.trait_type} +

+

{attrs.value}

+
+ ); + } + )}
+ }, + })} +
+
+ +
+
+ +
- ); - }, - }); +
+
+ ); };