From 7b392bc4549ecaaae49ac662ec2eae982e948eed Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 26 Nov 2024 13:14:33 +0800 Subject: [PATCH 1/2] expose on TextInput --- Client/src/Components/Inputs/TextInput/index.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Client/src/Components/Inputs/TextInput/index.jsx b/Client/src/Components/Inputs/TextInput/index.jsx index 4d648803a..b78ca5439 100644 --- a/Client/src/Components/Inputs/TextInput/index.jsx +++ b/Client/src/Components/Inputs/TextInput/index.jsx @@ -6,6 +6,11 @@ import PropTypes from "prop-types"; const getSx = (theme, type, maxWidth) => { const sx = { maxWidth: maxWidth, + "& .MuiFormHelperText-root": { + position: "absolute", + bottom: `-${theme.spacing(12)}`, + minHeight: theme.spacing(12), + }, }; if (type === "url") { @@ -57,6 +62,7 @@ const TextInput = forwardRef( ( { id, + name, type, value, placeholder, @@ -91,6 +97,7 @@ const TextInput = forwardRef( Date: Tue, 26 Nov 2024 13:14:46 +0800 Subject: [PATCH 2/2] integrate TextInput into register page --- Client/src/Components/Check/Check.jsx | 3 +-- Client/src/Pages/Auth/Register/StepOne/index.jsx | 13 ++++++++----- Client/src/Pages/Auth/Register/StepThree/index.jsx | 11 ++++++----- Client/src/Pages/Auth/Register/StepTwo/index.jsx | 6 ++++-- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Client/src/Components/Check/Check.jsx b/Client/src/Components/Check/Check.jsx index 3219fec29..799fda63c 100644 --- a/Client/src/Components/Check/Check.jsx +++ b/Client/src/Components/Check/Check.jsx @@ -24,10 +24,9 @@ const Check = ({ text, noHighlightText, variant = "info", outlined = false }) => const theme = useTheme(); const colors = { success: theme.palette.success.main, - error: theme.palette.error.contrastText, + error: theme.palette.error.main, info: theme.palette.info.border, }; - return ( - - - - - (e.target.value = e.target.value.toLowerCase())} onChange={onChange} - error={errors.email} + error={errors.email ? true : false} + helperText={errors.email} ref={inputRef} />