Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mui #1732

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open

mui #1732

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 37 additions & 32 deletions client/src/components/presentational/returnUserForm.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import React from 'react';
import { Box } from '@mui/material';
import Button from '@mui/material/Button';
import { FormControl, FormLabel, TextField } from '@mui/material';

const ReturnUserForm = (props) => {
return (
<div className="check-in-container">
<div className="check-in-headers">
<h3>Welcome back!</h3>
</div>
<div className="check-in-form">
<form
<Box className="check-in-container">
<Box className="check-in-headers">
<Typography variant="h3">Welcome back!</Typography>
</Box>
<Box className="check-in-form">
<FormControl
className="form-check-in"
autoComplete="on"
onSubmit={(e) => e.preventDefault()}
>
<div className="form-row">
<div className="form-input-text">
<label htmlFor="email">
<Box className="form-row">
<Box className="form-input-text">
<FormLabel htmlFor="email">
Which email address did you use to check-in last time?
</label>
<input
</FormLabel>
<TextField
type="email"
name="email"
placeholder="Email Address"
Expand All @@ -27,23 +30,24 @@ const ReturnUserForm = (props) => {
required
autoComplete="email"
/>
</div>
</Box>
<p>
{"(This allows easy use of the app. We'll never sell your data!)"}
</p>
</div>
</Box>

{props.isError && props.errorMessage.length > 1 &&
<div className="error">{props.errorMessage}</div>
}
{props.isError && props.errorMessage.length > 1 && (
<Box className="error">{props.errorMessage}</Box>
)}
{props.user === false && (
<div className="error">Try entering your email again.</div>
<Box className="error">Try entering your email again.</Box>
)}

{!props.user && !props.isLoading ? (
<div className="form-row">
<div className="form-input-button">
<button
<Box className="form-row">
<Box className="form-input-button">
<Button
variant="contained"
type="submit"
className="form-check-in-submit"
onClick={(e) => props.checkEmail(e)}
Expand All @@ -52,25 +56,26 @@ const ReturnUserForm = (props) => {
}
>
CHECK IN
</button>
</div>
</div>
</Button>
</Box>
</Box>
) : (
<div className="form-row">
<div className="form-input-button">
<button
<Box className="form-row">
<Box className="form-input-button">
<Button
variant="contained"
type="submit"
className="form-check-in-submit block"
onClick={(e) => e.preventDefault()}
>
CHECKING IN...
</button>
</div>
</div>
</Button>
</Box>
</Box>
)}
</form>
</div>
</div>
</FormControl>
</Box>
</Box>
);
};
export default ReturnUserForm;
Loading