mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-14 09:26:49 +02:00
✨ Allow making email required (#864)
This commit is contained in:
parent
b9d4b31f38
commit
a9253bd972
16 changed files with 516 additions and 495 deletions
|
@ -39,6 +39,9 @@ export const CreatePoll: React.FunctionComponent = () => {
|
|||
|
||||
const form = useForm<NewEventData>({
|
||||
defaultValues: {
|
||||
title: "",
|
||||
description: "",
|
||||
location: "",
|
||||
view: "month",
|
||||
options: [],
|
||||
hideScores: false,
|
||||
|
@ -73,6 +76,7 @@ export const CreatePoll: React.FunctionComponent = () => {
|
|||
hideParticipants: formData?.hideParticipants,
|
||||
disableComments: formData?.disableComments,
|
||||
hideScores: formData?.hideScores,
|
||||
requireParticipantEmail: formData?.requireParticipantEmail,
|
||||
options: required(formData?.options).map((option) => ({
|
||||
startDate: option.type === "date" ? option.date : option.start,
|
||||
endDate: option.type === "timeSlot" ? option.end : undefined,
|
||||
|
@ -115,7 +119,9 @@ export const CreatePoll: React.FunctionComponent = () => {
|
|||
<PollSettingsForm />
|
||||
<hr />
|
||||
<Button
|
||||
loading={form.formState.isSubmitting}
|
||||
loading={
|
||||
form.formState.isSubmitting || form.formState.isSubmitSuccessful
|
||||
}
|
||||
size="lg"
|
||||
type="submit"
|
||||
className="w-full"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue