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>
|
||||
) => {
|
||||
return (
|
||||
<>
|
||||
<div className={className}>
|
||||
<div
|
||||
className={classNames(
|
||||
styles.container,
|
||||
hasError && styles.error,
|
||||
icon && styles.withIcon,
|
||||
disabled && styles.disabled,
|
||||
readOnly && styles.readOnly,
|
||||
className
|
||||
readOnly && styles.readOnly
|
||||
)}
|
||||
>
|
||||
{icon && <span className={styles.icon}>{icon}</span>}
|
||||
<input type="text" {...rest} ref={reference} disabled={disabled} readOnly={readOnly} />
|
||||
</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">
|
||||
<TextInput
|
||||
{...register('branding.slogan', { required: isSloganRequired })}
|
||||
hasError={Boolean(isSloganRequired && errors.branding?.slogan)}
|
||||
hasError={Boolean(errors.branding?.slogan)}
|
||||
/>
|
||||
</FormField>
|
||||
</>
|
||||
|
|
|
@ -34,7 +34,7 @@ const TermsForm = () => {
|
|||
>
|
||||
<TextInput
|
||||
{...register('termsOfUse.contentUrl', { required: enabled })}
|
||||
hasError={Boolean(enabled && errors.termsOfUse)}
|
||||
hasError={Boolean(errors.termsOfUse)}
|
||||
/>
|
||||
</FormField>
|
||||
</>
|
||||
|
|
Loading…
Reference in a new issue