From 4401f083f21e1d11da85b0acfd912d856a21fe50 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 18 Jan 2023 15:31:34 +0800 Subject: [PATCH] chore: update input ui component --- packages/app/src/ui/input/Input.tsx | 3 +++ packages/app/src/ui/input/style.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app/src/ui/input/Input.tsx b/packages/app/src/ui/input/Input.tsx index c4fe7600ca..1ca8b8684f 100644 --- a/packages/app/src/ui/input/Input.tsx +++ b/packages/app/src/ui/input/Input.tsx @@ -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} > ); }; diff --git a/packages/app/src/ui/input/style.ts b/packages/app/src/ui/input/style.ts index fd0e4d21f1..b8cb51c3d2 100644 --- a/packages/app/src/ui/input/style.ts +++ b/packages/app/src/ui/input/style.ts @@ -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,