Add components and hooks for event theme management
Some checks failed
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 49s

Introduced the `usePresignedUpload` hook for file uploads and multiple components for event theme management, including form handling, asset uploads, and UI enhancements. These additions support creating, editing, and managing event themes effectively.
This commit is contained in:
2025-03-13 08:36:20 +01:00
parent f2f8d85775
commit 4044d85410
7 changed files with 1137 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
"use client";
import React, { useEffect } from "react";
import { useParams } from "next/navigation";
import { useEventThemes } from "@/context/event-theme-context";
import { Card, CardContent } from "@/components/ui/card";
import { Loader2 } from "lucide-react";
import { EventThemeForm } from "@/components/event-themes/event-theme-form";
export default function EditThemePage() {
const params = useParams();
const themeId = params.id as string;
const { theme, isLoadingTheme, fetchThemeById } = useEventThemes();
useEffect(() => {
if (themeId) {
fetchThemeById(themeId);
}
}, [themeId, fetchThemeById]);
if (isLoadingTheme) {
return (
<Card className="w-full flex justify-center items-center p-12">
<CardContent>
<div className="flex flex-col items-center space-y-4">
<Loader2 className="h-8 w-8 animate-spin text-primary" />
<p className="text-lg text-gray-600">Loading theme...</p>
</div>
</CardContent>
</Card>
);
}
if (!theme) {
return (
<Card className="w-full p-12">
<CardContent>
<div className="text-center text-red-600">
<h2 className="text-xl font-semibold">Theme not found</h2>
<p className="mt-2">
The theme you are trying to edit could not be found.
</p>
</div>
</CardContent>
</Card>
);
}
return (
<div className="container mx-auto py-6 space-y-6">
<h1 className="text-3xl font-bold">Edit Theme: {theme.name}</h1>
<p className="text-gray-600">
Make changes to your theme. These changes will affect all events using
this theme.
</p>
<EventThemeForm mode="edit" theme={theme} />
</div>
);
}

View File

@@ -0,0 +1,17 @@
"use client";
import React from "react";
import { EventThemeForm } from "@/components/event-themes/event-theme-form";
export default function NewThemePage() {
return (
<div className="container mx-auto py-6 space-y-6">
<h1 className="text-3xl font-bold">Create New Theme</h1>
<p className="text-gray-600">
Create a new theme for your events. Themes control the visual appearance
of your invitation pages and can include colors, fonts, and images.
</p>
<EventThemeForm mode="create" />
</div>
);
}