feat(event-form): replace toast notification with custom ToastInner component

This commit is contained in:
micha 2025-06-19 04:32:09 +02:00
parent 71315cbb5b
commit 9a187788c4

View file

@ -14,7 +14,7 @@ import {
import ParticipantListEntry from '@/components/custom-ui/participantListEntry'; import ParticipantListEntry from '@/components/custom-ui/participantListEntry';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import { toast } from 'sonner'; import { toast } from 'sonner';
import { CalendarCheck } from 'lucide-react'; import { ToastInner } from '@/components/misc/toast-inner';
interface EventFormProps { interface EventFormProps {
type: 'create' | 'edit'; type: 'create' | 'edit';
@ -134,10 +134,16 @@ const EventForm: React.FC<EventFormProps> = (props) => {
createEvent({ data }); createEvent({ data });
} }
toast('Event saved successfully', { toast.custom((t) => (
description: `Your event "${data.title}" has been saved.`, <ToastInner
icon: <CalendarCheck />, toastId={t}
}); title='Event saved'
description={event?.title}
onAction={() => router.push(`/event/${event?.id}`)}
variant='success'
buttonText='show'
/>
));
router.back(); router.back();
} }