chore: update input ui component

This commit is contained in:
JimmFly 2023-01-18 15:31:34 +08:00
parent 32babd8026
commit 4401f083f2
2 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@ type inputProps = {
placeholder?: string;
disabled?: boolean;
width?: number;
height?: number;
maxLength?: number;
minLength?: number;
onChange?: (value: string) => void;
@ -26,6 +27,7 @@ export const Input = (props: inputProps) => {
placeholder,
maxLength,
minLength,
height,
width = 260,
onChange,
onBlur,
@ -62,6 +64,7 @@ export const Input = (props: inputProps) => {
onChange={handleChange}
onBlur={handleBlur}
onKeyDown={handleKeyDown}
height={height}
></StyledInput>
);
};

View File

@ -4,7 +4,8 @@ export const StyledInput = styled('input')<{
disabled?: boolean;
value?: string;
width: number;
}>(({ theme, width, disabled }) => {
height?: number;
}>(({ theme, width, disabled, height }) => {
const fontWeight = 400;
const fontSize = '16px';
return {
@ -13,6 +14,7 @@ export const StyledInput = styled('input')<{
padding: '8px 12px',
fontWeight,
fontSize,
height: height ? `${height}px` : 'auto',
color: disabled ? theme.colors.disableColor : theme.colors.inputColor,
border: `1px solid`,
borderColor: theme.colors.borderColor, // TODO: check out disableColor,