diff --git a/client/src/components/presentational/newUserForm.jsx b/client/src/components/presentational/newUserForm.jsx index 178be15fb..f0e9c193c 100644 --- a/client/src/components/presentational/newUserForm.jsx +++ b/client/src/components/presentational/newUserForm.jsx @@ -1,9 +1,18 @@ -import React, { useState } from 'react'; -import { FormControl, TextField } from '@mui/material'; +import { useState } from 'react'; +import { + Box, + Button, + FormControl, + FormControlLabel, + FormLabel, + Radio, + RadioGroup, + TextField, + Typography, +} from '@mui/material'; import { DatePicker } from '@mui/x-date-pickers/DatePicker'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'; -import { format } from 'date-fns'; import '../../sass/CheckIn.scss'; const NewUserForm = (props) => { @@ -17,142 +26,187 @@ const NewUserForm = (props) => { console.error('Invalid date selected:', newValue); } }; + // MUI InputLabelProps Style + const InputLabelProps = { + sx: { + backgroundColor: 'white', + px: 0, // padding left/right + width: '17em', + '&.Mui-focused': { + mt: 0.4, // only applies when the input is focused + }, + '&.MuiInputLabel-shrink': { + mt: 0.4, + }, + }, + }; + // MUI FormLabel Style + const FormLabelStyle = { + color: 'black', + fontWeight: 500, + }; 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 ( + props.questions.map( + (question) => question.type === 'text' && ( -
-
- - -
-
- ) - ); - })} + + + + ), + )} {props.questions.length !== 0 && - props.questions.map((question) => { - return ( + 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 ( + props.questions.map( + (question) => question.htmlName === 'attendanceLength' && ( -
-
- + { maxWidth: '300px', borderBottom: 'none', '& input[type=text]': { - height: '40px', - width: '100%', - borderBottom: 'none', - paddingLeft: '0.5rem', - color: 'rgb(250, 17, 79)', - fontWeight: '600', // semi-bold - }, + height: '40px', + width: '100%', + borderBottom: 'none', + paddingLeft: '0.5rem', + color: 'rgb(250, 17, 79)', + fontWeight: '600', // semi-bold + }, + label: { + backgroundColor: 'white', + width: '8em', + }, }} > {(params) => ( @@ -190,45 +248,36 @@ const NewUserForm = (props) => { )} -
-
- ) - ); - })} + +
+ ), + )} {props.isError && props.errorMessage.length > 1 && ( -
{props.errorMessage}
+ {props.errorMessage} )} {!props.isLoading ? ( -
-
- -
-
+ + + ) : ( -
-
- -
-
+ + + )} -
-
-
+ + +
); };