From 2d03fda9f1af12d5b99a3dc6dda36dfbc2999ce3 Mon Sep 17 00:00:00 2001 From: Rushikeshnimkar Date: Tue, 1 Oct 2024 20:29:55 +0530 Subject: [PATCH] update : ui --- components/Mintbox.tsx | 36 +++++++++++++++++++++++++++ components/NftdataCard.tsx | 51 +++++++++++++++++++++++++++----------- components/UserNFTs.tsx | 2 +- pages/mint.js | 4 +-- pages/subscription.tsx | 7 +++++- 5 files changed, 81 insertions(+), 19 deletions(-) create mode 100644 components/Mintbox.tsx diff --git a/components/Mintbox.tsx b/components/Mintbox.tsx new file mode 100644 index 0000000..0d353a4 --- /dev/null +++ b/components/Mintbox.tsx @@ -0,0 +1,36 @@ +'use client' + +import React from 'react'; +import { FiPlus } from 'react-icons/fi'; +import { motion } from 'framer-motion'; +import { useRouter } from 'next/router'; + +export default function Mintbox() { + const router = useRouter(); + + const handleNavigate = () => { + router.push('/mint'); + }; + + return ( +
+ +
+

Mint

+
+ +

Click to navigate to Mint page

+
+
+
+
+ ); +} \ No newline at end of file diff --git a/components/NftdataCard.tsx b/components/NftdataCard.tsx index 2e5b97d..066a1e1 100644 --- a/components/NftdataCard.tsx +++ b/components/NftdataCard.tsx @@ -2,7 +2,7 @@ import Link from "next/link"; // import { removePrefix } from "../utils/ipfsUtil"; import React, {useEffect} from "react"; import axios from "axios"; -// import eye2 from "../public/eye2.png"; +import { FaPaperclip } from "react-icons/fa"; import Image from "next/image"; interface ReviewCardProps { @@ -139,7 +139,17 @@ const NftdataCard: React.FC = ({ return (
-
+
+ {chainSymbol === 'sol' && ( +
+ Solana Icon + +
+ )}
@@ -159,6 +169,14 @@ const NftdataCard: React.FC = ({
{metaData.current_token_data.token_name}
+ `} + target="_blank" + rel="noopener noreferrer" + className="mt-5 text-white" + > + +
@@ -171,20 +189,23 @@ const NftdataCard: React.FC = ({
{attributes && chainSymbol === 'sol' && ( -
- {attributes.map((attr, index) => ( -
{attr.value}
- ))} -
- )} + +
+ {attributes.map((attr, index) => ( +
{attr.value}
+ ))} + +
+ + )} - {attributes && chainSymbol !== 'sol' && ( -
- {Object.entries(attributes).map(([key, value]) => ( -
{key}: {value.toString()}
- ))} -
- )} + {attributes && chainSymbol !== 'sol' && ( +
+ {Object.entries(attributes).map(([key, value]) => ( +
{key}: {value.toString()}
+ ))} +
+ )}
diff --git a/components/UserNFTs.tsx b/components/UserNFTs.tsx index 2686097..c22af25 100644 --- a/components/UserNFTs.tsx +++ b/components/UserNFTs.tsx @@ -29,7 +29,7 @@ const fetchUserNFTs = async (userAddress: string, chainSymbol: string) => { const userNFTs = await metaplex.nfts().findAllByOwner({ owner: ownerPublicKey }); console.log('All user NFTs:', userNFTs); - const erebrusNFTs = userNFTs.filter(nft => nft.name === "Erebrus Community NFT").map(nft => ({ + const erebrusNFTs = userNFTs.filter(nft => nft.symbol === "EVPN").map(nft => ({ amount: 1, current_token_data: { token_name: nft.name, diff --git a/pages/mint.js b/pages/mint.js index 5b76ae7..d22f1cc 100644 --- a/pages/mint.js +++ b/pages/mint.js @@ -251,7 +251,7 @@ const Mint = () => { const umiWithWallet = umi.use(walletAdapterIdentity(solanaWallet)) .use(mplTokenMetadata()); - const metadataUri = "https://gateway.pinata.cloud/ipfs/QmX8Z8DT3vRSVyLyzTos1EVuTbWSgvWgCEPGL5vAgt95p4"; + const metadataUri = "https://gateway.pinata.cloud/ipfs/QmNnMvEMnwNH9XhB1triVkVc1qVknV6dx61adDSSTFn54T"; console.log("Using metadata URI:", metadataUri); // Fetch and log the metadata to verify its contents @@ -271,7 +271,7 @@ const Mint = () => { const mint = generateSigner(umiWithWallet); const { signature } = await createNft(umiWithWallet, { mint, - name: "Erebrus Community NFT", + name: "Erebrus Community NFT #001", symbol: "EVPN", uri: metadataUri, sellerFeeBasisPoints: percentAmount(5.5), // 5.5% royalties diff --git a/pages/subscription.tsx b/pages/subscription.tsx index cee4225..592212a 100644 --- a/pages/subscription.tsx +++ b/pages/subscription.tsx @@ -27,6 +27,8 @@ const graphqlaptos = process.env.NEXT_PUBLIC_GRAPHQL_APTOS; import Login from "../components/loginComponent"; import UserNFTs from "../components/UserNFTs"; import fetchUserNFTs from "../components/UserNFTs"; +import Mintbox from "../components/Mintbox"; + export interface FlowIdResponse { eula: string; @@ -901,6 +903,9 @@ const Subscription = () => {
)} + + + {trialsubscriptiondata && (
{
)} - +