mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(console): error message in text input component (#1060)
This commit is contained in:
parent
5a5083e863
commit
93916bfa54
3 changed files with 5 additions and 6 deletions
|
@ -14,22 +14,21 @@ const TextInput = (
|
||||||
reference: ForwardedRef<HTMLInputElement>
|
reference: ForwardedRef<HTMLInputElement>
|
||||||
) => {
|
) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<div className={className}>
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
styles.container,
|
styles.container,
|
||||||
hasError && styles.error,
|
hasError && styles.error,
|
||||||
icon && styles.withIcon,
|
icon && styles.withIcon,
|
||||||
disabled && styles.disabled,
|
disabled && styles.disabled,
|
||||||
readOnly && styles.readOnly,
|
readOnly && styles.readOnly
|
||||||
className
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{icon && <span className={styles.icon}>{icon}</span>}
|
{icon && <span className={styles.icon}>{icon}</span>}
|
||||||
<input type="text" {...rest} ref={reference} disabled={disabled} readOnly={readOnly} />
|
<input type="text" {...rest} ref={reference} disabled={disabled} readOnly={readOnly} />
|
||||||
</div>
|
</div>
|
||||||
{hasError && errorMessage && <div className={styles.errorMessage}>{errorMessage}</div>}
|
{hasError && errorMessage && <div className={styles.errorMessage}>{errorMessage}</div>}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ const BrandingForm = () => {
|
||||||
<FormField isRequired={isSloganRequired} title="admin_console.sign_in_exp.branding.slogan">
|
<FormField isRequired={isSloganRequired} title="admin_console.sign_in_exp.branding.slogan">
|
||||||
<TextInput
|
<TextInput
|
||||||
{...register('branding.slogan', { required: isSloganRequired })}
|
{...register('branding.slogan', { required: isSloganRequired })}
|
||||||
hasError={Boolean(isSloganRequired && errors.branding?.slogan)}
|
hasError={Boolean(errors.branding?.slogan)}
|
||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -34,7 +34,7 @@ const TermsForm = () => {
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
{...register('termsOfUse.contentUrl', { required: enabled })}
|
{...register('termsOfUse.contentUrl', { required: enabled })}
|
||||||
hasError={Boolean(enabled && errors.termsOfUse)}
|
hasError={Boolean(errors.termsOfUse)}
|
||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in a new issue