fix console warning
This commit is contained in:
parent
260b18fb95
commit
e47cd766db
|
@ -126,7 +126,7 @@ const CreateAccountForm = ({
|
|||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setName(e.target.value)
|
||||
}
|
||||
charLimit={30}
|
||||
maxLength={30}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-4">
|
||||
|
|
|
@ -4,7 +4,7 @@ interface InputProps {
|
|||
type: string
|
||||
value: any
|
||||
onChange: (e: ChangeEvent<HTMLInputElement>) => void
|
||||
charLimit?: number
|
||||
maxLength?: number
|
||||
className?: string
|
||||
disabled?: boolean
|
||||
prefixClassname?: string
|
||||
|
@ -21,7 +21,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {
|
|||
type,
|
||||
value,
|
||||
onChange,
|
||||
charLimit,
|
||||
maxLength,
|
||||
className,
|
||||
error,
|
||||
wrapperClassName = 'w-full',
|
||||
|
@ -59,20 +59,20 @@ const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {
|
|||
type={type}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
maxLength={charLimit && charLimit}
|
||||
maxLength={maxLength ? maxLength : undefined}
|
||||
/>
|
||||
{suffix ? (
|
||||
<span className="absolute right-0 flex h-full items-center bg-transparent pr-2 text-xs text-th-fgd-4">
|
||||
{suffix}
|
||||
</span>
|
||||
) : null}
|
||||
{charLimit ? (
|
||||
{maxLength ? (
|
||||
<p
|
||||
className={`absolute -top-7 right-0 mt-1 flex justify-end text-xs ${
|
||||
value.length === charLimit ? 'text-th-down' : 'text-th-fgd-4'
|
||||
value.length === maxLength ? 'text-th-down' : 'text-th-fgd-4'
|
||||
}`}
|
||||
>
|
||||
{`${value.length}/${charLimit}`}
|
||||
{`${value.length}/${maxLength}`}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
|
|
@ -64,7 +64,7 @@ const AccountNameModal = ({ isOpen, onClose }: ModalProps) => {
|
|||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setName(e.target.value)
|
||||
}
|
||||
charLimit={30}
|
||||
maxLength={30}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
|
|
|
@ -365,7 +365,7 @@ const UserSetupModal = ({
|
|||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setAccountName(e.target.value)
|
||||
}
|
||||
charLimit={30}
|
||||
maxLength={30}
|
||||
/>
|
||||
</div>
|
||||
<SolBalanceWarnings className="mt-4" />
|
||||
|
|
|
@ -164,7 +164,7 @@ const EditProfileForm = ({
|
|||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
onChangeNameInput(e.target.value)
|
||||
}
|
||||
charLimit={20}
|
||||
maxLength={20}
|
||||
/>
|
||||
{inputError ? (
|
||||
<div className="mt-1.5 flex items-center space-x-1">
|
||||
|
|
Loading…
Reference in New Issue