diff --git a/packages/components/cards/NFTAttributeCard.tsx b/packages/components/cards/NFTAttributeCard.tsx index 30d4dcc9da..5c90f61fc0 100644 --- a/packages/components/cards/NFTAttributeCard.tsx +++ b/packages/components/cards/NFTAttributeCard.tsx @@ -2,7 +2,6 @@ import React from "react"; import { StyleProp, View, ViewStyle } from "react-native"; import { AttributeRarityFloor } from "../../api/marketplace/v1/marketplace"; -import { NFTInfo } from "../../screens/Marketplace/NFTDetailScreen"; import { resolveColor } from "../../screens/Marketplace/utils"; import { prettyPrice } from "../../utils/coins"; import { @@ -11,6 +10,7 @@ import { fontSemibold12, } from "../../utils/style/fonts"; import { layout } from "../../utils/style/layout"; +import { NFTInfo } from "../../utils/types/nft"; import { BrandText } from "../BrandText"; import { TertiaryBox } from "../boxes/TertiaryBox"; diff --git a/packages/components/cards/NFTCancelListingCard.tsx b/packages/components/cards/NFTCancelListingCard.tsx index 61eb13278c..0378388a7e 100644 --- a/packages/components/cards/NFTCancelListingCard.tsx +++ b/packages/components/cards/NFTCancelListingCard.tsx @@ -1,9 +1,9 @@ import React from "react"; import { StyleProp, View, ViewStyle } from "react-native"; -import { NFTInfo } from "../../screens/Marketplace/NFTDetailScreen"; import { prettyPrice } from "../../utils/coins"; import { fontSemibold12, fontSemibold28 } from "../../utils/style/fonts"; +import { NFTInfo } from "../../utils/types/nft"; import { BrandText } from "../BrandText"; import { CurrencyIcon } from "../CurrencyIcon"; import { TertiaryBox } from "../boxes/TertiaryBox"; diff --git a/packages/components/cards/NFTPriceBuyCard.tsx b/packages/components/cards/NFTPriceBuyCard.tsx index 0ae2c706ca..e424a4e94c 100644 --- a/packages/components/cards/NFTPriceBuyCard.tsx +++ b/packages/components/cards/NFTPriceBuyCard.tsx @@ -1,9 +1,9 @@ import React from "react"; import { StyleProp, View, ViewStyle } from "react-native"; -import { NFTInfo } from "../../screens/Marketplace/NFTDetailScreen"; import { prettyPrice } from "../../utils/coins"; import { fontSemibold12, fontSemibold28 } from "../../utils/style/fonts"; +import { NFTInfo } from "../../utils/types/nft"; import { BrandText } from "../BrandText"; import { CurrencyIcon } from "../CurrencyIcon"; import { TertiaryBox } from "../boxes/TertiaryBox"; diff --git a/packages/components/cards/NFTSellCard.tsx b/packages/components/cards/NFTSellCard.tsx index 4f0a0d9c9e..2c6ead2132 100644 --- a/packages/components/cards/NFTSellCard.tsx +++ b/packages/components/cards/NFTSellCard.tsx @@ -6,7 +6,7 @@ import { getNativeCurrency, keplrCurrencyFromNativeCurrencyInfo, } from "../../networks"; -import { NFTInfo } from "../../screens/Marketplace/NFTDetailScreen"; +import { NFTInfo } from "../../utils/types/nft"; import { TertiaryBox } from "../boxes/TertiaryBox"; import { PrimaryButton } from "../buttons/PrimaryButton"; import { TextInputCustom } from "../inputs/TextInputCustom"; diff --git a/packages/components/nftDetails/NFTAttributes.tsx b/packages/components/nftDetails/NFTAttributes.tsx index 3fbae1c4e2..cb1530954b 100644 --- a/packages/components/nftDetails/NFTAttributes.tsx +++ b/packages/components/nftDetails/NFTAttributes.tsx @@ -2,8 +2,8 @@ import React, { useState } from "react"; import { View } from "react-native"; import { AttributeRarityFloor } from "../../api/marketplace/v1/marketplace"; -import { NFTInfo } from "../../screens/Marketplace/NFTDetailScreen"; import { neutral33 } from "../../utils/style/colors"; +import { NFTInfo } from "../../utils/types/nft"; import { ToggleableButton } from "../buttons/ToggleableButton"; import { NFTAttributeCard } from "../cards/NFTAttributeCard"; diff --git a/packages/components/nftDetails/NFTMainInfo.tsx b/packages/components/nftDetails/NFTMainInfo.tsx index a9b0fe6918..bcc5daca78 100644 --- a/packages/components/nftDetails/NFTMainInfo.tsx +++ b/packages/components/nftDetails/NFTMainInfo.tsx @@ -11,7 +11,6 @@ import { } from "../../api/marketplace/v1/marketplace"; import { useTransactionModals } from "../../context/TransactionModalsProvider"; import { parseNetworkObjectId } from "../../networks"; -import { NFTInfo } from "../../screens/Marketplace/NFTDetailScreen"; import { mustGetMarketplaceClient } from "../../utils/backend"; import { RootStackParamList } from "../../utils/navigation"; import { neutral77, primaryColor } from "../../utils/style/colors"; @@ -22,6 +21,7 @@ import { fontSemibold28, } from "../../utils/style/fonts"; import { layout, screenContentMaxWidth } from "../../utils/style/layout"; +import { NFTInfo } from "../../utils/types/nft"; import { BrandText } from "../BrandText"; import { ImageWithTextInsert } from "../ImageWithTextInsert"; import { ActivityTable } from "../activity/ActivityTable"; @@ -262,7 +262,13 @@ export const NFTMainInfo: React.FC<{ )} ) : ( - + <> + + + Marketplace Not Opened Yet + + + )} - + + + { const [network, minterContractAddress, tokenId] = parseNftId(nftId); diff --git a/packages/screens/Marketplace/NFTDetailScreen.tsx b/packages/screens/Marketplace/NFTDetailScreen.tsx index 35939b1130..eb55b95eaa 100644 --- a/packages/screens/Marketplace/NFTDetailScreen.tsx +++ b/packages/screens/Marketplace/NFTDetailScreen.tsx @@ -21,41 +21,16 @@ import { useNFTInfo } from "../../hooks/useNFTInfo"; import useSelectedWallet from "../../hooks/useSelectedWallet"; import { useSellNFT } from "../../hooks/useSellNFT"; import { - NetworkKind, getCollectionId, getKeplrSigningCosmWasmClient, mustGetCosmosNetwork, mustGetEthereumNetwork, + NetworkKind, parseNftId, } from "../../networks"; import { getMetaMaskEthereumSigner } from "../../utils/ethereum"; import { ScreenFC, useAppNavigation } from "../../utils/navigation"; -import { NFTAttribute } from "../../utils/types/nft"; - -export interface NFTInfo { - name: string; - description: string; - attributes: NFTAttribute[]; - nftAddress: string; - imageURL: string; - tokenId: string; - mintAddress: string; - ownerAddress: string; - isSeller: boolean; - isListed: boolean; - isOwner: boolean; - canSell: boolean; - price: string; - priceDenom: string; - collectionName: string; - textInsert?: string; - collectionImageURL: string; - mintDenom: string; - royalty: number; - breedingsAvailable?: number; - networkId: string; - collectionId: string; -} +import { NFTInfo } from "../../utils/types/nft"; const Content: React.FC<{ id: string; diff --git a/packages/utils/types/nft.ts b/packages/utils/types/nft.ts index b08b820f95..81bca29e15 100644 --- a/packages/utils/types/nft.ts +++ b/packages/utils/types/nft.ts @@ -18,3 +18,28 @@ export type FooterNftData = NftData & { imageUri: string; borderRadius: number; }; + +export interface NFTInfo { + name: string; + description: string; + attributes: NFTAttribute[]; + nftAddress: string; + imageURL: string; + tokenId: string; + mintAddress: string; + ownerAddress: string; + isSeller: boolean; + isListed: boolean; + isOwner: boolean; + canSell: boolean; + price: string; + priceDenom: string; + collectionName: string; + textInsert?: string; + collectionImageURL: string; + mintDenom: string; + royalty: number; + breedingsAvailable?: number; + networkId: string; + collectionId: string; +}