From ac7874318c91a9fe1a985faa4037f3b82ee30559 Mon Sep 17 00:00:00 2001 From: Shay Patel Date: Sat, 26 Oct 2024 15:25:36 +0100 Subject: [PATCH] Refactor file structure --- app/Home.tsx | 67 ----------------- app/TicketListings/page.tsx | 9 --- app/contact/page.tsx | 75 +++++++++++++++++++ .../TicketListings.tsx => events/page.tsx} | 4 +- app/page.tsx | 64 +++++++++++++++- components/custom/header.tsx | 2 +- 6 files changed, 139 insertions(+), 82 deletions(-) delete mode 100644 app/Home.tsx delete mode 100644 app/TicketListings/page.tsx create mode 100644 app/contact/page.tsx rename app/{TicketListings/TicketListings.tsx => events/page.tsx} (99%) diff --git a/app/Home.tsx b/app/Home.tsx deleted file mode 100644 index 75eb149..0000000 --- a/app/Home.tsx +++ /dev/null @@ -1,67 +0,0 @@ -'use client'; -import { useEffect, useState } from 'react'; -import Header from '../components/custom/header'; -import Footer from '../components/custom/footer'; - -export default function Home() { - const [isClient, setIsClient] = useState(false); - - useEffect(() => { - setIsClient(true); - }, []); - - return ( - <> -
-
- {/* Video Background */} - {isClient && ( - - )} - - {/* Dark Overlay for Enhanced Readability */} -
- - {/* Page Content Over the Video */} -
-
- -
-
-

- Featured Events -

-

- No events available at the moment. -

-
-
-

- Upcoming Events -

-
    -
  • Event 1 - Date
  • -
  • Event 2 - Date
  • -
  • Event 3 - Date
  • -
-
-
-
-
-
-
- - ); -} diff --git a/app/TicketListings/page.tsx b/app/TicketListings/page.tsx deleted file mode 100644 index 42e8cd6..0000000 --- a/app/TicketListings/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import TicketListings from './TicketListings'; - -export default function Page() { - return ( - <> - - - ); -} diff --git a/app/contact/page.tsx b/app/contact/page.tsx new file mode 100644 index 0000000..c219b7a --- /dev/null +++ b/app/contact/page.tsx @@ -0,0 +1,75 @@ +'use client'; +import React, { useEffect, useState, useRef } from 'react'; +import Header from '../../components/custom/header'; +import Footer from '../../components/custom/footer'; + +// Define the Event interface including new fields +interface Event { + EventID: number; + name: string; + date: string; // Should ideally be a Date object for better handling + location: string; + ticketPrice: number; // Changed to number for sorting + description: string; + capacity: number; + ticketsSold: number; + imageUrl: string; + host: string; // New field for host +} + +// Dummy function to fetch events +const fetchEvents = (): Event[] => { + return [ + { + EventID: 1, + name: 'Rock Concert', + date: '2023-12-01', + location: 'New York City', + ticketPrice: 99, + description: 'An exhilarating rock concert featuring famous bands.', + capacity: 5000, + ticketsSold: 4500, + imageUrl: 'https://via.placeholder.com/150', + host: 'Music Mania', + }, + { + EventID: 2, + name: 'Art Expo', + date: '2023-11-15', + location: 'San Francisco', + ticketPrice: 55, + description: 'A showcase of modern art from around the world.', + capacity: 300, + ticketsSold: 260, + imageUrl: 'https://via.placeholder.com/150', + host: 'Art Lovers', + }, + { + EventID: 3, + name: 'Tech Summit 2023', + date: '2023-12-10', + location: 'Chicago', + ticketPrice: 250, + description: 'The leading tech summit with top industry speakers.', + capacity: 2000, + ticketsSold: 1800, + imageUrl: 'https://via.placeholder.com/150', + host: 'Tech Alliance', + }, + ]; +}; + +const ContactPage: React.FC = () => { + return ( +
+
+
+ {/* implement contact page here */} +

Page to be implemented

+
+
+
+ ); +}; + +export default ContactPage; diff --git a/app/TicketListings/TicketListings.tsx b/app/events/page.tsx similarity index 99% rename from app/TicketListings/TicketListings.tsx rename to app/events/page.tsx index 46efa5f..7bda79c 100644 --- a/app/TicketListings/TicketListings.tsx +++ b/app/events/page.tsx @@ -59,7 +59,7 @@ const fetchEvents = (): Event[] => { ]; }; -const TicketListing: React.FC = () => { +const EventsPage: React.FC = () => { const [events, setEvents] = useState([]); const [filteredEvents, setFilteredEvents] = useState([]); const [searchQuery, setSearchQuery] = useState(''); @@ -340,4 +340,4 @@ const TicketListing: React.FC = () => { ); }; -export default TicketListing; +export default EventsPage; diff --git a/app/page.tsx b/app/page.tsx index 03b69a9..75eb149 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,9 +1,67 @@ -import Home from './Home'; +'use client'; +import { useEffect, useState } from 'react'; +import Header from '../components/custom/header'; +import Footer from '../components/custom/footer'; + +export default function Home() { + const [isClient, setIsClient] = useState(false); + + useEffect(() => { + setIsClient(true); + }, []); -export default function Page() { return ( <> - +
+
+ {/* Video Background */} + {isClient && ( + + )} + + {/* Dark Overlay for Enhanced Readability */} +
+ + {/* Page Content Over the Video */} +
+
+ +
+
+

+ Featured Events +

+

+ No events available at the moment. +

+
+
+

+ Upcoming Events +

+
    +
  • Event 1 - Date
  • +
  • Event 2 - Date
  • +
  • Event 3 - Date
  • +
+
+
+
+
+
+
); } diff --git a/components/custom/header.tsx b/components/custom/header.tsx index 910e978..01ce86c 100644 --- a/components/custom/header.tsx +++ b/components/custom/header.tsx @@ -46,7 +46,7 @@ const Header = () => {
  • - + Events