From 8948ea66c744d971376680a4ed5ce93394fd2d42 Mon Sep 17 00:00:00 2001 From: KetanKudikyal Date: Mon, 4 Aug 2025 01:58:44 +0530 Subject: [PATCH 1/2] Remove unused mock data and event rendering logic Deleted mock data for featured calendars and the unused renderEventItem and renderEmptyState functions from EventsScreen.tsx to clean up the component. Also updated FlatList to display all events instead of slicing to three. --- tickity-rn-app/components/EventsScreen.tsx | 81 +--------------------- 1 file changed, 1 insertion(+), 80 deletions(-) diff --git a/tickity-rn-app/components/EventsScreen.tsx b/tickity-rn-app/components/EventsScreen.tsx index ef523c3..1c12c3f 100644 --- a/tickity-rn-app/components/EventsScreen.tsx +++ b/tickity-rn-app/components/EventsScreen.tsx @@ -59,31 +59,6 @@ const cities = [ }, ]; -// Mock data for featured calendars -const featuredCalendars = [ - { - id: "1", - title: "Reading Rhythms Global", - description: - "Not a book club. A reading party. Read with friends to live music & curated playlists.", - icon: "📚", - }, - { - id: "2", - title: "ADPList", - description: - "Your favorite all-things happening at ADPList! We feature local meetups, ADPList events, and more.", - icon: "😊", - }, - { - id: "3", - title: "Tech Meetups", - description: - "Discover the latest in technology with local tech enthusiasts and industry experts.", - icon: "💻", - }, -]; - const EventsScreen = () => { const { data, isLoading, error, refetch } = useGetEvents(); const router = useRouter(); @@ -138,60 +113,6 @@ const EventsScreen = () => { ); - const renderEventItem = ({ item }: { item: Event }) => ( - - - - - - - - - {item.name || `Event #${item.eventAddress}`} - - - {item.description || "Amazing event experience awaits you"} - - - - - Date - - {format( - new Date(Number(item.startTime) * 1000), - "MMM d, yyyy" - ) || "Coming Soon"} - - - - ID - #{item.id.slice(-6)} - - - - router.push(`/${item.eventAddress}`)} - > - View Details - - - - - ); - - const renderEmptyState = () => ( - - No events found - - ); - return ( { ) : ( Date: Mon, 4 Aug 2025 16:00:01 +0530 Subject: [PATCH 2/2] Add NFT collection display and user NFT hook Introduces AnimatedNFTCard and NFTCard components for displaying user NFTs with gradient styling. Adds useGetUserNFTs hook to fetch and manage user's NFT tickets. Updates favourites screen to show user's NFT collection, loading, and error states. Removes redundant header from account screen and updates event cities in EventsScreen. Adds bigIntHelper utility for safe BigInt serialization. --- tickity-rn-app/app/(tabs)/account.tsx | 7 - tickity-rn-app/app/(tabs)/favourites.tsx | 224 +++++++++++-- tickity-rn-app/components/AnimatedNFTCard.tsx | 302 ++++++++++++++++++ tickity-rn-app/components/EventsScreen.tsx | 35 +- tickity-rn-app/components/NFTCard.tsx | 248 ++++++++++++++ tickity-rn-app/hooks/useGetUserNFTs.tsx | 155 +++++++++ tickity-rn-app/utils/bigIntHelper.ts | 48 +++ 7 files changed, 963 insertions(+), 56 deletions(-) create mode 100644 tickity-rn-app/components/AnimatedNFTCard.tsx create mode 100644 tickity-rn-app/components/NFTCard.tsx create mode 100644 tickity-rn-app/hooks/useGetUserNFTs.tsx create mode 100644 tickity-rn-app/utils/bigIntHelper.ts diff --git a/tickity-rn-app/app/(tabs)/account.tsx b/tickity-rn-app/app/(tabs)/account.tsx index 5c2fa02..3bbd2f1 100644 --- a/tickity-rn-app/app/(tabs)/account.tsx +++ b/tickity-rn-app/app/(tabs)/account.tsx @@ -102,13 +102,6 @@ export default function AccountScreen() { /> } > - - Account - - Manage your wallet and preferences - - - {account ? ( {/* Wallet Info Card */} diff --git a/tickity-rn-app/app/(tabs)/favourites.tsx b/tickity-rn-app/app/(tabs)/favourites.tsx index 5bd90d2..d26b44e 100644 --- a/tickity-rn-app/app/(tabs)/favourites.tsx +++ b/tickity-rn-app/app/(tabs)/favourites.tsx @@ -1,28 +1,122 @@ +import AnimatedNFTCard from "@/components/AnimatedNFTCard"; +import useGetUserNFTs from "@/hooks/useGetUserNFTs"; +import { LinearGradient } from "expo-linear-gradient"; import { router } from "expo-router"; -import React, { useState } from "react"; -import { Button, StyleSheet, Text, View } from "react-native"; +import React from "react"; +import { + ActivityIndicator, + Dimensions, + FlatList, + RefreshControl, + StyleSheet, + Text, + View, +} from "react-native"; + +const { width } = Dimensions.get("window"); const Favourites = () => { - const [showAR, setShowAR] = useState(false); + const { nfts, hasNFTs, nftCount, isLoading, error, refetch } = + useGetUserNFTs(); - return ( - - Favourites + const renderNFTCard = ({ item, index }: { item: any; index: number }) => ( + { + // Navigate to NFT details or event page + router.push(`/yourevent/${item.eventAddress}`); + }} + /> + ); + + const renderEmptyState = () => ( + + + + 🎫 + No NFTs Yet + + Your minted NFTs will appear here + + + Purchase tickets to events and they'll be displayed as beautiful + NFTs in your collection + + + + + ); + + const renderHeader = () => ( + + My NFT Collection - Here you'll find all your favourite events in one place + {hasNFTs + ? `You have ${nftCount} minted NFT${nftCount !== 1 ? "s" : ""}` + : "Your minted NFTs will appear here"} - - Save events you love and access them quickly whenever you need them - - -