From 4f647028e7aaba42bab6c426fe5dbeab52744e67 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Fri, 1 Nov 2024 19:10:50 -0400 Subject: [PATCH] feat: getting rid of tab index -1 and setting form with semantics on login and register --- Client/src/Pages/Auth/Login.jsx | 128 +++++++++++------- Client/src/Pages/Auth/Register/Register.jsx | 4 + .../src/Pages/Auth/Register/StepOne/index.jsx | 99 ++++++++------ .../Pages/Auth/Register/StepThree/index.jsx | 69 ++++++---- .../src/Pages/Auth/Register/StepTwo/index.jsx | 112 ++++++++------- 5 files changed, 238 insertions(+), 174 deletions(-) diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index 7afefda84..7014e2113 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -51,6 +51,10 @@ const LandingPage = ({ onContinue }) => { stroke: theme.palette.other.icon, }, }, + "&:focus-visible": { + outline: `2px solid ${theme.palette.primary.main}`, + outlineOffset: `2px`, + }, }} > @@ -137,56 +141,68 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => { Log In Enter your email address - -
- (e.target.value = e.target.value.toLowerCase())} - onChange={onChange} - error={errors.email} - ref={inputRef} - /> - -
- - - - + + + + ); @@ -285,8 +301,11 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { "& svg.MuiSvgIcon-root": { mr: theme.spacing(3), }, + "&:focus-visible": { + outline: `2px solid ${theme.palette.primary.main}`, + outlineOffset: `2px`, + }, }} - props={{ tabIndex: -1 }} > Back @@ -294,9 +313,16 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { diff --git a/Client/src/Pages/Auth/Register/Register.jsx b/Client/src/Pages/Auth/Register/Register.jsx index abb933d57..2f4c26040 100644 --- a/Client/src/Pages/Auth/Register/Register.jsx +++ b/Client/src/Pages/Auth/Register/Register.jsx @@ -53,6 +53,10 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => { stroke: theme.palette.other.icon, }, }, + "&:focus-visible": { + outline: `2px solid ${theme.palette.primary.main}`, + outlineOffset: `2px`, + }, }} > diff --git a/Client/src/Pages/Auth/Register/StepOne/index.jsx b/Client/src/Pages/Auth/Register/StepOne/index.jsx index 8867b2794..4a6997ef4 100644 --- a/Client/src/Pages/Auth/Register/StepOne/index.jsx +++ b/Client/src/Pages/Auth/Register/StepOne/index.jsx @@ -37,21 +37,28 @@ function StepOne({ form, errors, onSubmit, onChange, onBack }) { return ( <> + {/* TODO this stack should be a component */} Sign Up Enter your personal details - + + - - + + {/* TODO buttons should be a component should be a component */} + + + - - - - ); diff --git a/Client/src/Pages/Auth/Register/StepThree/index.jsx b/Client/src/Pages/Auth/Register/StepThree/index.jsx index fb72969f0..13d6a130f 100644 --- a/Client/src/Pages/Auth/Register/StepThree/index.jsx +++ b/Client/src/Pages/Auth/Register/StepThree/index.jsx @@ -47,39 +47,44 @@ function StepThree({ onSubmit, onBack }) { spellCheck={false} onSubmit={onSubmit} textAlign="left" + display="grid" + gap={{ xs: theme.spacing(12), sm: theme.spacing(16) }} sx={{ - display: "grid", - gap: theme.spacing(8), "& .input-error": { display: "none", }, }} > - - + + + + Back @@ -147,7 +151,14 @@ function StepThree({ onSubmit, onBack }) { form.confirm.length === 0 || Object.keys(errors).length !== 0 } - sx={{ width: "30%" }} + sx={{ + width: "30%", + "&.Mui-focusVisible": { + outline: `2px solid ${theme.palette.primary.main}`, + outlineOffset: `2px`, + boxShadow: `none`, + }, + }} > Continue diff --git a/Client/src/Pages/Auth/Register/StepTwo/index.jsx b/Client/src/Pages/Auth/Register/StepTwo/index.jsx index 567a82818..e4236c0bc 100644 --- a/Client/src/Pages/Auth/Register/StepTwo/index.jsx +++ b/Client/src/Pages/Auth/Register/StepTwo/index.jsx @@ -44,58 +44,70 @@ function StepTwo({ form, errors, onSubmit, onChange, onBack }) { Sign Up Enter your email address - - - (e.target.value = e.target.value.toLowerCase())} - onChange={onChange} - error={errors.email} - ref={inputRef} - /> - - - - - - + + + + );