From 6570fdada4a63d225105ba9ff1a8119b34252195 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Tue, 7 Nov 2023 10:10:27 -0500 Subject: [PATCH] feat: improve event and ticket creation UI --- .../BondscapeDateTimePicker.tsx | 13 +++++++++ .../create/[[...id]]/CreateTicketCategory.tsx | 28 ++++++++++++------- app/creator/create/[[...id]]/MainSection.tsx | 24 ++++++++-------- 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/app/creator/create/BondscapeDateTimePicker/BondscapeDateTimePicker.tsx b/app/creator/create/BondscapeDateTimePicker/BondscapeDateTimePicker.tsx index 26b860a..da619ee 100644 --- a/app/creator/create/BondscapeDateTimePicker/BondscapeDateTimePicker.tsx +++ b/app/creator/create/BondscapeDateTimePicker/BondscapeDateTimePicker.tsx @@ -6,6 +6,8 @@ import React, { useState } from "react"; import "./style.css"; interface Props { + readonly title?: string; + readonly description?: string; readonly startLabel?: string; readonly endLabel?: string; readonly initialStartValue?: string; @@ -13,9 +15,12 @@ interface Props { readonly required: boolean; readonly onChangeStart: (value: string | undefined) => void; readonly onChangeEnd: (value: string | undefined) => void; + readonly footer?: React.ReactNode; } const BondscapeDateTimePicker = ({ + title, + description, startLabel, endLabel, initialStartValue, @@ -23,6 +28,7 @@ const BondscapeDateTimePicker = ({ required, onChangeStart, onChangeEnd, + footer, }: Props) => { const [minDate, setMinDate] = useState(); const [maxDate, setMaxDate] = useState(); @@ -57,6 +63,11 @@ const BondscapeDateTimePicker = ({ return (
+
+ {title &&
{title}
} + {description &&
{description}
} +
+
+ + {footer &&
{footer}
}
); }; diff --git a/app/creator/create/[[...id]]/CreateTicketCategory.tsx b/app/creator/create/[[...id]]/CreateTicketCategory.tsx index e8d76ac..784c37c 100644 --- a/app/creator/create/[[...id]]/CreateTicketCategory.tsx +++ b/app/creator/create/[[...id]]/CreateTicketCategory.tsx @@ -130,9 +130,12 @@ const CreateTicketCategory = ({ )}
+
+
Category info
+
setFieldValue("category", text)} @@ -153,10 +156,17 @@ const CreateTicketCategory = ({ )}
+
+
Tickets quantities
+
+ Here you can define the maximum amount of tickets that a single user can get for this + category, as well as the maximum amount of tickets available for this category. +
+
setFieldValue( @@ -169,8 +179,8 @@ const CreateTicketCategory = ({ /> setFieldValue( @@ -183,6 +193,8 @@ const CreateTicketCategory = ({ />
setFieldValue("availableUntil", value) } + footer="The availability time will be in the time zone based on where the event will be held." /> -
- { - "The availability time will be in the time zone based on where the event will be held." - } -
-
+
- {(!values.startDate || !values.endDate) && ( -
- { - "The event can only be published if the dates are entered; otherwise, it can only be saved as a draft." - } -
- )} setFieldValue("startDate", value)} onChangeEnd={(value) => setFieldValue("endDate", value)} - /> -
- { - "The start/end time of the event will be in the time zone based on where the event will be held." + footer={ +
+ The start and end dates of the event will be in the time zone based on where the event will be held. + If no location is entered, the timezone will default to the UTC time zone. + +
+ The event can only be published if the dates are entered; otherwise, it can only be saved as a draft. +
+
} -
+ />