summaryrefslogtreecommitdiff
path: root/src/features
diff options
context:
space:
mode:
authorMichael Hunteman <michael@huntm.net>2024-03-03 12:23:59 -0800
committerMichael Hunteman <michael@huntm.net>2024-03-03 12:23:59 -0800
commit37768908d2271d00d6d87fef24ad6e9ac17c97e8 (patch)
tree7ac7f3520fccb7e578c6ddf1eb282b76733ff853 /src/features
parent535a57ba6c3060193a7a12e05135fffd209c7d97 (diff)
Mark text fields as required
Diffstat (limited to 'src/features')
-rw-r--r--src/features/auth/GuestLogin.tsx70
1 files changed, 36 insertions, 34 deletions
diff --git a/src/features/auth/GuestLogin.tsx b/src/features/auth/GuestLogin.tsx
index cbab494..c3b3b96 100644
--- a/src/features/auth/GuestLogin.tsx
+++ b/src/features/auth/GuestLogin.tsx
@@ -27,42 +27,44 @@ function GuestLogin() {
};
return (
- <Container component="form" maxWidth="xs" onSubmit={handleSubmit(onSubmit)}>
- <Box
- sx={{ mt: 8,
- display: "flex",
- flexDirection: "column",
+ <Container component="form" maxWidth="xs" noValidate onSubmit={handleSubmit(onSubmit)}>
+ <Box
+ sx={{ mt: 8,
+ display: "flex",
+ flexDirection: "column",
alignItems: "center" }}
>
- <Typography variant="h6">
- Guest Login
- </Typography>
- <TextField
- label="First Name"
- variant="outlined"
- margin="normal"
- fullWidth
- error={!!errors.firstName}
- helperText={errors.firstName?.message}
- {...register("firstName", { required: "Please enter your first name" })}
- />
- <TextField
- label="Last Name"
- variant="outlined"
- margin="normal"
- fullWidth
- error={!!errors.lastName}
- helperText={errors.lastName?.message}
- {...register("lastName", { required: "Please enter your last name" })}
- />
- <Button
- type="submit"
- variant="contained"
- fullWidth
- sx={{ mt: 2 }}
- >
- Log in
- </Button>
+ <Typography variant="h6">
+ Guest Login
+ </Typography>
+ <TextField
+ label="First Name"
+ variant="outlined"
+ margin="normal"
+ fullWidth
+ error={!!errors.firstName}
+ helperText={errors.firstName?.message}
+ required
+ {...register("firstName", { required: "This field is required" })}
+ />
+ <TextField
+ label="Last Name"
+ variant="outlined"
+ margin="normal"
+ fullWidth
+ error={!!errors.lastName}
+ helperText={errors.lastName?.message}
+ required
+ {...register("lastName", { required: "This field is required" })}
+ />
+ <Button
+ type="submit"
+ variant="contained"
+ fullWidth
+ sx={{ mt: 2 }}
+ >
+ Log in
+ </Button>
</Box>
</Container>
);