From 0d8652a703344a376f41b4324349254fd603b188 Mon Sep 17 00:00:00 2001 From: jodeleeuw Date: Tue, 12 Mar 2024 08:58:51 -0400 Subject: [PATCH 1/2] add select component --- pages/admin/new.js | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/pages/admin/new.js b/pages/admin/new.js index 1f145fc..4df1dbe 100644 --- a/pages/admin/new.js +++ b/pages/admin/new.js @@ -1,11 +1,6 @@ import { customAlphabet } from "nanoid"; import AuthCheck from "../../components/AuthCheck"; -import { - doc, - getDoc, - writeBatch, - arrayUnion, -} from "firebase/firestore"; +import { doc, getDoc, writeBatch, arrayUnion } from "firebase/firestore"; import { db, auth } from "../../lib/firebase"; import { useContext, useState } from "react"; import { UserContext } from "../../lib/context"; @@ -26,6 +21,7 @@ import { FormHelperText, VStack, Text, + Select, } from "@chakra-ui/react"; export default function NewExperimentPage({}) { @@ -42,7 +38,7 @@ function NewExperimentForm() { const [osfError, setOsfError] = useState(false); const [titleError, setTitleError] = useState(false); const [dataComponentError, setDataComponentError] = useState(false); - + const [data, loading, error] = useDocumentData(doc(db, "users", user.uid)); return ( @@ -53,8 +49,10 @@ function NewExperimentForm() { Create a New Experiment Title - setTitleError(false)} /> - This field is required + setTitleError(false)} /> + + This field is required + Existing OSF Project @@ -70,9 +68,24 @@ function NewExperimentForm() { New OSF Data Component Name - setDataComponentError(false)}/> - This field is required - DataPipe will create a new component with this name in the OSF project and store all data in it. + setDataComponentError(false)} /> + + This field is required + + + DataPipe will create a new component with this name in the OSF + project and store all data in it. + + + + Storage Location + + + Choose the region where the data will be stored. +