diff options
author | Michael Hunteman <michael@huntm.net> | 2024-03-03 12:23:59 -0800 |
---|---|---|
committer | Michael Hunteman <michael@huntm.net> | 2024-03-03 12:23:59 -0800 |
commit | 37768908d2271d00d6d87fef24ad6e9ac17c97e8 (patch) | |
tree | 7ac7f3520fccb7e578c6ddf1eb282b76733ff853 /src/features/auth | |
parent | 535a57ba6c3060193a7a12e05135fffd209c7d97 (diff) |
Mark text fields as required
Diffstat (limited to 'src/features/auth')
-rw-r--r-- | src/features/auth/GuestLogin.tsx | 70 |
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> ); |