diff --git a/client/src/components/presentational/newUserForm.js b/client/src/components/presentational/newUserForm.js index 56612696..47a07bca 100644 --- a/client/src/components/presentational/newUserForm.js +++ b/client/src/components/presentational/newUserForm.js @@ -1,202 +1,161 @@ -import React from "react"; +import React from 'react'; +import { TextField, Button, Radio, RadioGroup, FormControlLabel, FormControl, FormLabel, Typography, Box } from '@mui/material'; const NewUserForm = (props) => { return ( -
-
-

Welcome!

-

Tell us a little bit about yourself:

-
-
+ + + Welcome! + Tell us a little bit about yourself: + +
e.preventDefault()} > -
-
- -
-
-
-
- -
-
-
-
- - -
-
+ + + + + + + + + {props.questions.length !== 0 && - props.questions.map((question) => { - return ( - question.type === "text" && ( -
-
- - -
-
- ) - ); - })} + props.questions.map((question) => ( + question.type === "text" && ( + + + + ) + ))} {props.questions.length !== 0 && - props.questions.map((question) => { - return ( - question.type === "select" && ( -
-
- -
- - - - -
-
-
- ) - ); - })} + props.questions.map((question) => ( + question.type === "select" && ( + + + {question.questionText} + + } label="Yes" /> + } label="No" /> + + + + ) + ))} {props.newMember === true ? null : props.questions.length !== 0 && - props.questions.map((question) => { - return ( - question.htmlName === "attendanceLength" && ( -
-
- -
+ props.questions.map((question) => ( + question.htmlName === "attendanceLength" && ( + + + {question.questionText} + - {props.months.map((month, index) => { - return ( - - ); - })} + {props.months.map((month, index) => ( + + ))} + } + /> + - {props.years.map((year, index) => { - return ( - - ); - })} + {props.years.map((year, index) => ( + + ))} -
-
-
- ) - ); - })} + } + /> + + + ) + ))} {props.isError && props.errorMessage.length > 1 && -
{props.errorMessage}
+ {props.errorMessage} } {!props.isLoading ? ( -
-
- -
-
+ + + ) : ( -
-
- -
-
+ + + )}
-
-
+ + ); }; + export default NewUserForm;