From bf1276abef4d2f6ed7f8e763a5cc8cc026e96886 Mon Sep 17 00:00:00 2001 From: gracekenn Date: Mon, 30 Mar 2026 12:36:44 +0100 Subject: [PATCH 1/2] ... --- .../components/events/create-event-form.tsx | 157 ++++++++++++++---- apps/web/components/events/event-card.tsx | 16 ++ apps/web/components/layout/navbar.tsx | 19 ++- apps/web/components/ui/button.tsx | 27 ++- server/src/main.rs | 37 +++-- 5 files changed, 208 insertions(+), 48 deletions(-) diff --git a/apps/web/components/events/create-event-form.tsx b/apps/web/components/events/create-event-form.tsx index 2fc319f..971e27e 100644 --- a/apps/web/components/events/create-event-form.tsx +++ b/apps/web/components/events/create-event-form.tsx @@ -1,20 +1,35 @@ "use client"; -import { useState } from "react"; import { Button } from "@/components/ui/button"; import Image from "next/image"; +import { useState } from "react"; +/** + * Form data structure for creating a new event + * @interface EventFormData + */ export type EventFormData = { + /** Title of the event */ title: string; + /** Start date in YYYY-MM-DD format */ startDate: string; + /** Start time in HH:MM format */ startTime: string; + /** End date in YYYY-MM-DD format */ endDate: string; + /** End time in HH:MM format */ endTime: string; + /** Timezone identifier (e.g., "GMT+00:00 UTC") */ timezone: string; + /** Physical or virtual location */ location: string; + /** Detailed description of the event */ description: string; + /** Event visibility setting */ visibility: "Public" | "Private"; + /** Maximum number of attendees */ capacity: string; + /** Ticket price (empty string for free events) */ price: string; }; @@ -32,12 +47,19 @@ const initialFormState: EventFormData = { price: "", }; +/** + * CreateEventForm component for creating new events + * + * @returns React component that renders a form for creating events + */ export default function CreateEventForm() { const [formData, setFormData] = useState(initialFormState); - const [locationMode, setLocationMode] = useState<"Virtual" | "Physical">("Physical"); + const [locationMode, setLocationMode] = useState<"Virtual" | "Physical">( + "Physical", + ); const handleChange = ( - e: React.ChangeEvent + e: React.ChangeEvent, ) => { const { name, value } = e.target; @@ -71,7 +93,8 @@ export default function CreateEventForm() { const isSubmitDisabled = !formData.title.trim() || !formData.startDate.trim(); // Common Neubrutalist class for form controls - const neubrutalistInputClass = "w-full bg-white border border-gray-100 rounded-xl focus-within:border-black focus-within:border-2 focus-within:shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] transition-all"; + const neubrutalistInputClass = + "w-full bg-white border border-gray-100 rounded-xl focus-within:border-black focus-within:border-2 focus-within:shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] transition-all"; return (
@@ -90,7 +113,9 @@ export default function CreateEventForm() { {/* Date & Time Section */}
-
+
@@ -114,7 +139,7 @@ export default function CreateEventForm() { />
-
+
End @@ -137,7 +162,7 @@ export default function CreateEventForm() { />
- +
GMT+00:00 @@ -151,38 +176,68 @@ export default function CreateEventForm() { {/* Location Section */}
- +
- -
{/* Description Section */} -
- +
+