fix bug 1807

master
HOANGLAOTA 1 year ago
parent 272d39a4ca
commit e8555e7ae7
  1. 29
      src/_components/AdvisementForm/AdvisementForm.jsx
  2. 6
      src/_components/AdvisementForm/AdvisementForm.logic.js
  3. 4
      src/_components/AdvisementForm/AdvisementForm.style.scss
  4. 28
      src/_components/Auth/InputText/index.js
  5. 21
      src/_components/Auth/InputText/index.scss

@ -64,14 +64,31 @@ const AdvisementForm = (props) => {
) no-repeat top center /cover`, ) no-repeat top center /cover`,
}} }}
> >
<div> <div className="">
{props.type == userConstants.ROLE_TEACHER ? ( {props.type == userConstants.ROLE_TEACHER ? (
<>
<img <img
src="/assets/images/homeNews/content/teacher/title_advisement_teacher.png" src="/assets/images/homeNews/content/teacher/title_advisement_teacher.png"
alt="Titlte Advisement" alt="Titlte Advisement"
className="contain_image title_header_teacher" className="contain_image title_header_teacher text-align-center display_none_mobile"
style={{width: '90%'}}
/>
<div className="flex-center-column hide display_flex_mobile">
<img
src="/assets/images/homeNews/content/teacher/title_advisement_teacher_1_mobile.png"
alt="Titlte Advisement"
className="contain_image title_header_teacher_1_mobile text-align-center"
style={{width: '90%'}} style={{width: '90%'}}
/> />
<img
src="/assets/images/homeNews/content/teacher/title_advisement_teacher_2_mobile.png"
alt="Titlte Advisement"
className="contain_image title_header_teacher_2_mobile text-align-center"
style={{width: '90%'}}
/>
</div>
</>
) : ( ) : (
<> <>
<img <img
@ -131,6 +148,7 @@ const AdvisementForm = (props) => {
onBlurField("name"); onBlurField("name");
}} }}
errorAbsolute={true} errorAbsolute={true}
showRequired
/> />
<InputText <InputText
value={phone} value={phone}
@ -146,6 +164,7 @@ const AdvisementForm = (props) => {
onBlurField("phone"); onBlurField("phone");
}} }}
errorAbsolute={true} errorAbsolute={true}
showRequired
/> />
<InputText <InputText
value={email} value={email}
@ -153,7 +172,7 @@ const AdvisementForm = (props) => {
type="text" type="text"
name="email" name="email"
placeholder="Email" placeholder="Email"
required={true} // required={true}
// renderLabelIcon={() => renderAuthIcon("phone")} // renderLabelIcon={() => renderAuthIcon("phone")}
errorText={emailError} errorText={emailError}
setErrorText={setEmailError} setErrorText={setEmailError}
@ -207,6 +226,10 @@ const AdvisementForm = (props) => {
type="text" type="text"
name="message" name="message"
placeholder="Lời nhắn" placeholder="Lời nhắn"
multiLine
inputProps={{
rows: 3
}}
/> />
{/* <InputSelectNews {/* <InputSelectNews

@ -238,7 +238,7 @@ export const advisementLogic = (props) => {
phone && phone &&
!nameUserError && !nameUserError &&
!phoneWarning && !phoneWarning &&
!!email?.trim() && // !!email?.trim() &&
!emailError !emailError
// timeAdvisement?.value && // timeAdvisement?.value &&
// !timeAdvisementError // !timeAdvisementError
@ -274,10 +274,6 @@ export const advisementLogic = (props) => {
} else { } else {
if (!phone) { if (!phone) {
setPhoneWarning("Vui lòng nhập thông tin."); setPhoneWarning("Vui lòng nhập thông tin.");
} else {
if(!email) {
setEmailError("Vui lòng nhập thông tin.")
}
} }
} }
} }

@ -186,12 +186,12 @@
} }
.input_text_base { .input_text_base {
padding: 0 1.2rem !important; padding: 0 1.2rem;
} }
.input_text_base, .input_text_base,
.input_select_main_wrapper { .input_select_main_wrapper {
height: clamp(3.2rem, 4vw, 3.375rem) !important; height: clamp(3.2rem, 4vw, 3.375rem);
border: none; border: none;
background-color: var(--white-color) !important; background-color: var(--white-color) !important;
margin-bottom: 2.3rem; margin-bottom: 2.3rem;

@ -105,6 +105,7 @@ const InputText = (props) => {
<span>{props.errorText}</span> <span>{props.errorText}</span>
</div> </div>
) : null} ) : null}
{props?.showRequired && <div className="input_text_required">*</div>}
<div <div
ref={$inputRef} ref={$inputRef}
className={classnames( className={classnames(
@ -123,6 +124,7 @@ const InputText = (props) => {
<div className={`icon_label ${!props.renderLabelIcon && "hide"}`}> <div className={`icon_label ${!props.renderLabelIcon && "hide"}`}>
{props.renderLabelIcon ? props.renderLabelIcon() : null} {props.renderLabelIcon ? props.renderLabelIcon() : null}
</div> </div>
{!props?.multiLine ?
<input <input
readOnly={props.readOnly} readOnly={props.readOnly}
type={renderType()} type={renderType()}
@ -145,7 +147,33 @@ const InputText = (props) => {
props.autoComplete ? props.autoComplete : "new-password" props.autoComplete ? props.autoComplete : "new-password"
} }
autoFocus={props?.autoFocus ? props.autoFocus : false} autoFocus={props?.autoFocus ? props.autoFocus : false}
{...props?.inputProps}
/> :
<textarea
readOnly={props.readOnly}
type={renderType()}
name={props.name}
placeholder={props.placeholder}
required={props.required}
className={`input_text input_text_area ${
props.readOnly && " notallowed_cursor"
}`}
value={props.value}
onChange={props.onChange ? props.onChange : changeValue}
onFocus={() => {
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}
/> />
}
{props.typeSearch == "search" && props.value ? ( {props.typeSearch == "search" && props.value ? (
<div <div
className="flex-center pointer_cursor no_select" className="flex-center pointer_cursor no_select"

@ -3,9 +3,25 @@
$red: #e22028; $red: #e22028;
$border-color: #4a4848; $border-color: #4a4848;
.input_text_base:has(.input_text_area) {
height: auto !important;
padding-top: 6px !important;
padding-bottom: 6px !important;
}
.input_text_base_container { .input_text_base_container {
position: relative; position: relative;
.input_text_required {
position: absolute;
right: 4px;
top: 4px;
color: red;
display: block;
font-size: 26px;
line-height: 16px;
}
.error_input { .error_input {
span { span {
color: $red; color: $red;
@ -100,6 +116,11 @@ $border-color: #4a4848;
font-size: 0.9rem !important; font-size: 0.9rem !important;
} }
} }
.input_text_area {
resize: none;
line-height: 26px;
}
} }
.toggle_password { .toggle_password {

Loading…
Cancel
Save