diff --git a/app/play/page.tsx b/app/play/page.tsx index a306f8f..dc23c9d 100644 --- a/app/play/page.tsx +++ b/app/play/page.tsx @@ -6,7 +6,6 @@ import MintScreen from '@/components/game/MintScreen'; import NFTScreen from '@/components/game/NFTScreen'; import Leaderboard from '@/components/game/Leaderboard'; import AppBar from '@/components/layout/AppBar'; -import Dashboard from '@/components/game/Dashboard'; const Play = () => { const [currentScreen, setCurrentScreen] = useState('game'); // Default to 'game' @@ -77,12 +76,8 @@ const Play = () => { onRestart={handleRestartGame} /> } - {currentScreen === 'dashboard' && ( - - )} - + + ); }; diff --git a/components/game/NFTScreen.tsx b/components/game/NFTScreen.tsx index 90fd91b..98746d2 100644 --- a/components/game/NFTScreen.tsx +++ b/components/game/NFTScreen.tsx @@ -1,39 +1,60 @@ "use client"; -import React, { useState } from 'react'; -import NFTGallery from '../ui/nftgallery'; -import { Button } from '../ui/button'; +import React, { useState } from "react"; +import NFTGallery from "../ui/nftgallery"; +import { Button } from "../ui/button"; interface NFTScreenProps { onViewLeaderboard: () => void; onRestart: () => void; } -const NFTScreen: React.FC = ({ onViewLeaderboard, onRestart }) => { - const [activeTab, setActiveTab] = useState<'all' | 'user'>('all'); +const NFTScreen: React.FC = ({ + onViewLeaderboard, + onRestart, +}) => { + const [activeTab, setActiveTab] = useState<"all" | "user">("all"); return (
-
-
- - +
+ {/* Tabs */} +
+
+ + +
+ + {/* NFT Gallery */} -
- - + + {/* Buttons */} +
+ +
-
); diff --git a/components/ui/nftgallery.tsx b/components/ui/nftgallery.tsx index 275b52e..e96fdab 100644 --- a/components/ui/nftgallery.tsx +++ b/components/ui/nftgallery.tsx @@ -1,30 +1,68 @@ -import React from 'react'; +import React, { useState } from 'react'; + +import Image from 'next/image'; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "../ui/dialog"; interface NFTGalleryProps { filter: 'all' | 'user'; } +interface NFT { + id: number; + image: string; + title: string; + owner?: string; +} + const NFTGallery: React.FC = ({ filter }) => { // Dummy data for demonstration purposes const allNFTs = [ - { id: 1, image: '/nft-placeholder.png', title: 'NFT 1' }, - { id: 2, image: '/nft-placeholder.png', title: 'NFT 2' }, + { id: 1, image: '/assets/cat4.jpeg', title: 'NFT 1', owner: 'Mercy' }, + { id: 2, image: '/assets/cat2.jpeg', title: 'NFT 2', owner: 'Jada' }, + { id: 3, image: '/assets/cat3.jpeg', title: 'NFT 3', owner: 'Mark' }, + { id: 4, image: '/assets/cat4.jpeg', title: 'NFT 4', owner: 'Jonah' }, + { id: 5, image: '/assets/cat2.jpeg', title: 'NFT 5', owner: 'Bezos' }, ]; const userNFTs = [ - { id: 1, image: '/nft-placeholder.png', title: 'User NFT 1' }, + { id: 1, image: '/assets/cat4.jpeg', title: 'User NFT 1', owner: 'You' }, ]; - // Choose which NFTs to display based on the active tab + //filter NFTs to display based on the active tab const nfts = filter === 'all' ? allNFTs : userNFTs; + const [selectedNFT, setSelectedNFT] = useState(null); + return ( -
+
{nfts.map((nft) => ( -
- {nft.title} -

{nft.title}

-
+ open ? setSelectedNFT(nft) : setSelectedNFT(null)}> + +
+ {nft.title} +

{nft.title}

+ {nft.owner &&

by {nft.owner}

} +
+
+ + {selectedNFT && ( + <> + + {selectedNFT.title} + {selectedNFT.owner && Owned by {selectedNFT.owner}} + + {selectedNFT.title} + + )} + +
))}
); diff --git a/public/assets/test.jpeg b/public/assets/test.jpeg new file mode 100644 index 0000000..35a621a Binary files /dev/null and b/public/assets/test.jpeg differ