From cce9632b5f82f10a59b10965682ff0649a1c2220 Mon Sep 17 00:00:00 2001 From: ashprit Date: Sun, 27 Oct 2024 01:55:58 +0000 Subject: [PATCH] adding all changes --- app/host/page.tsx | 105 +++++++++++++++++++++- components/ProfilePage.tsx | 120 ++++++++++++++++++++++++- components/custom/EventDescription.tsx | 2 +- components/custom/EventForm.tsx | 2 +- 4 files changed, 221 insertions(+), 8 deletions(-) diff --git a/app/host/page.tsx b/app/host/page.tsx index 89f8c98..f78c01e 100644 --- a/app/host/page.tsx +++ b/app/host/page.tsx @@ -1,14 +1,111 @@ 'use client'; import EventForm from '@/components/custom/EventForm'; -import React from 'react'; +import FeaturedEvent from '@/components/custom/FeaturedEvent'; +import Footer from '@/components/custom/footer'; +import Header from '@/components/custom/header'; +import { Button } from '@/components/ui/button'; +import { FlipWords } from '@/components/ui/flip-words'; +import { useRouter } from 'next/navigation'; +import React, { useEffect, useRef, useState } from 'react'; +import { motion } from 'framer-motion'; +import { EventFormData } from '@/components/custom/EventForm'; + +const Page = () => { + const router = useRouter(); + const [isClient, setIsClient] = useState(false); + const inputRef = useRef(null); + + useEffect(() => { + setIsClient(true); + }, []); + + function searchForEvents() { + if (inputRef.current && inputRef.current.value === '') return; + + if (inputRef.current) + router.replace('/events?q=' + encodeURIComponent(inputRef.current.value)); + } + + function handleSubmit(data: { + name: string; + description: string; + capacity: number; + ticketPrice: number; + location: string; + eventStartTime: Date; + eventEndTime?: Date | undefined; + images?: string[] | undefined; + }) { + // Logic for handling the form submission + console.log('Event data submitted:', data); + // You can replace the console log with an API call or any other handling logic + router.push('/events'); + } + + const words = [ + 'adventure', + 'concert', + 'outing', + 'journey', + 'hackathon', + 'conference', + ]; -const page = () => { return ( <> - {}} /> +
+
+ {/* Video Background */} + {isClient && ( + + )} + + {/* Dark Overlay for Enhanced Readability */} +
+ + {/* Page Content Over the Video */} +
+
+ +
+ + Create your event here! + + + + +
+
+
+
+
+
); }; -export default page; +export default Page; diff --git a/components/ProfilePage.tsx b/components/ProfilePage.tsx index e7135e3..6bd0bb8 100644 --- a/components/ProfilePage.tsx +++ b/components/ProfilePage.tsx @@ -1,7 +1,123 @@ -import React from 'react'; +import { useRouter } from 'next/router'; +// import { Input } from 'postcss'; // Removed incorrect import +import React, { useEffect, useRef, useState } from 'react'; +import FeaturedEvent from './custom/FeaturedEvent'; +import Footer from './custom/footer'; +import Header from './custom/header'; +import { Button } from './ui/button'; +import { FlipWords } from './ui/flip-words'; const ProfilePage = () => { - return
ProfilePage
; + const router = useRouter(); + const [isClient, setIsClient] = useState(false); + const inputRef: any = useRef(null); + + useEffect(() => { + setIsClient(true); + }, []); + + function searchForEvents() { + if (inputRef.current.value == '') return; + router.replace('/events?q=' + encodeURIComponent(inputRef.current.value)); + } + + const words = [ + 'adventure', + 'concert', + 'outing', + 'journey', + 'hackathon', + 'conference', + ]; + + return ( + <> +
+
+ {/* Video Background */} + {isClient && ( + + )} + + {/* Dark Overlay for Enhanced Readability */} +
+ + {/* Page Content Over the Video */} +
+
+
+
+ Book your next + + on the Flare blockchain. +
+
+ +
+ + +
+
+
+ + + +
+
+
+
+
+
+ + ); }; export default ProfilePage; diff --git a/components/custom/EventDescription.tsx b/components/custom/EventDescription.tsx index b790ae9..c41ad77 100644 --- a/components/custom/EventDescription.tsx +++ b/components/custom/EventDescription.tsx @@ -13,7 +13,7 @@ import { buyHandler } from '@/lib/buyHandler'; import { useToast } from '@/hooks/use-toast'; import NumberPicker from './TicketButton'; -interface EventDescriptionProps { +export interface EventDescriptionProps { eventDetails: { EventID: number; name: string; diff --git a/components/custom/EventForm.tsx b/components/custom/EventForm.tsx index 9273dd0..f6dfe64 100644 --- a/components/custom/EventForm.tsx +++ b/components/custom/EventForm.tsx @@ -58,7 +58,7 @@ const eventSchema = z }); // Define the TypeScript type based on the Zod schema -type EventFormData = z.infer; +export type EventFormData = z.infer; interface EventFormProps { onSubmit: (data: EventFormData) => void;