From e8555e7ae755dd89beb62fba6b82c93f22cef1bc Mon Sep 17 00:00:00 2001 From: HOANGLAOTA Date: Thu, 18 Jul 2024 09:02:04 +0700 Subject: [PATCH] fix bug 1807 --- .../AdvisementForm/AdvisementForm.jsx | 39 ++++++++-- .../AdvisementForm/AdvisementForm.logic.js | 8 +- .../AdvisementForm/AdvisementForm.style.scss | 4 +- src/_components/Auth/InputText/index.js | 74 +++++++++++++------ src/_components/Auth/InputText/index.scss | 21 ++++++ 5 files changed, 107 insertions(+), 39 deletions(-) diff --git a/src/_components/AdvisementForm/AdvisementForm.jsx b/src/_components/AdvisementForm/AdvisementForm.jsx index b307366..43fbc91 100644 --- a/src/_components/AdvisementForm/AdvisementForm.jsx +++ b/src/_components/AdvisementForm/AdvisementForm.jsx @@ -64,14 +64,31 @@ const AdvisementForm = (props) => { ) no-repeat top center /cover`, }} > -
+
{props.type == userConstants.ROLE_TEACHER ? ( - Titlte Advisement + <> + Titlte Advisement + +
+ Titlte Advisement + Titlte Advisement +
+ ) : ( <> { onBlurField("name"); }} errorAbsolute={true} + showRequired /> { onBlurField("phone"); }} errorAbsolute={true} + showRequired /> { type="text" name="email" placeholder="Email" - required={true} + // required={true} // renderLabelIcon={() => renderAuthIcon("phone")} errorText={emailError} setErrorText={setEmailError} @@ -207,6 +226,10 @@ const AdvisementForm = (props) => { type="text" name="message" placeholder="Lời nhắn" + multiLine + inputProps={{ + rows: 3 + }} /> {/* { phone && !nameUserError && !phoneWarning && - !!email?.trim() && + // !!email?.trim() && !emailError // timeAdvisement?.value && // !timeAdvisementError @@ -274,11 +274,7 @@ export const advisementLogic = (props) => { } else { if (!phone) { setPhoneWarning("Vui lòng nhập thông tin."); - } else { - if(!email) { - setEmailError("Vui lòng nhập thông tin.") - } - } + } } } }; diff --git a/src/_components/AdvisementForm/AdvisementForm.style.scss b/src/_components/AdvisementForm/AdvisementForm.style.scss index 8d0e512..3808461 100644 --- a/src/_components/AdvisementForm/AdvisementForm.style.scss +++ b/src/_components/AdvisementForm/AdvisementForm.style.scss @@ -186,12 +186,12 @@ } .input_text_base { - padding: 0 1.2rem !important; + padding: 0 1.2rem; } .input_text_base, .input_select_main_wrapper { - height: clamp(3.2rem, 4vw, 3.375rem) !important; + height: clamp(3.2rem, 4vw, 3.375rem); border: none; background-color: var(--white-color) !important; margin-bottom: 2.3rem; diff --git a/src/_components/Auth/InputText/index.js b/src/_components/Auth/InputText/index.js index 296889b..9f83788 100644 --- a/src/_components/Auth/InputText/index.js +++ b/src/_components/Auth/InputText/index.js @@ -105,6 +105,7 @@ const InputText = (props) => { {props.errorText}
) : null} + {props?.showRequired &&
*
}
{
{props.renderLabelIcon ? props.renderLabelIcon() : null}
- { - setIsFocus(true); - props.onFocus && props.onFocus(); - }} - min={props.min ? props.min : ""} - max={props.max ? props.max : ""} - onBlur={props.onBlur} - autoComplete={ - props.autoComplete ? props.autoComplete : "new-password" - } - autoFocus={props?.autoFocus ? props.autoFocus : false} - /> + {!props?.multiLine ? + { + setIsFocus(true); + props.onFocus && props.onFocus(); + }} + min={props.min ? props.min : ""} + max={props.max ? props.max : ""} + onBlur={props.onBlur} + autoComplete={ + props.autoComplete ? props.autoComplete : "new-password" + } + autoFocus={props?.autoFocus ? props.autoFocus : false} + {...props?.inputProps} + /> : +