diff --git a/src/pages/forms/new.tsx b/src/pages/forms/new.tsx index d8c7b71..7fb8722 100644 --- a/src/pages/forms/new.tsx +++ b/src/pages/forms/new.tsx @@ -25,7 +25,7 @@ export default function NewFormPage(props: NewFormPageProps) { // const [description, setDescription] = useState(''); const [formTopic, setFormTopic] = useState(''); const [title, setTitle] = useState(''); - const [fieldsGuidance, setFieldsGuidance] = useState(''); + const [isFormOpen, setIsFormOpen] = useState(true); const [fieldsSchema, setFieldsSchema] = useState('{}'); const { push } = useRouter(); const [user, setUser] = useState(null); @@ -70,7 +70,7 @@ export default function NewFormPage(props: NewFormPageProps) { fields_guidance: fieldsGuidance, fields_schema: fieldsSchema, id: formId, - is_open: true, + is_open: isFormOpen, name: title, user_id: user.id, }, @@ -199,6 +199,7 @@ Your output: }; const renderStepContent = () => { + if (step === 1) { if (step === 1) { return (
@@ -221,6 +222,17 @@ Your output: placeholder="Birthday party RSVP, # of guests, dietary restrictions..." />
+
+ + setIsFormOpen(e.target.checked)} + /> +
); + } else { } else { return (
@@ -350,17 +363,4 @@ Your output: )} - {step === 2 && ( - - )} -
- - - ); -} + {step === 2 && ( \ No newline at end of file