From 895ecb4f0524cc7ab1868ad66291f2cb1c5d1056 Mon Sep 17 00:00:00 2001 From: Guergana Tzatchkova Date: Thu, 19 Dec 2024 06:34:33 -0800 Subject: [PATCH] Fix textfield widths across the app (#695) --- client/components/Parts/Fields/Input.tsx | 53 ++++++++++---------- client/components/Parts/Fields/Multiline.tsx | 38 +++++++------- client/components/Parts/Fields/YesNo.tsx | 9 ++-- 3 files changed, 47 insertions(+), 53 deletions(-) diff --git a/client/components/Parts/Fields/Input.tsx b/client/components/Parts/Fields/Input.tsx index e42e8c1c..a66bef1c 100644 --- a/client/components/Parts/Fields/Input.tsx +++ b/client/components/Parts/Fields/Input.tsx @@ -32,43 +32,44 @@ export default function InputField(props: InputFieldProps) { const onFocus = props.onFocus || noop const onBlur = props.onBlur || noop return ( -
- - {props.label} - - onChange(ev.target.value)} - error={props.error} - required={props.required} - helperText={props.helperText} - onKeyDown={onKeyDown} - placeholder={props.placeholder} - onFocus={onFocus} - onBlur={onBlur} - autoFocus={props.autoFocus} - /> +
+ {props.label} + onChange(ev.target.value)} + error={props.error} + required={props.required} + helperText={props.helperText} + onKeyDown={onKeyDown} + placeholder={props.placeholder} + onFocus={onFocus} + onBlur={onBlur} + autoFocus={props.autoFocus} + />
) } -export const StyledTextField = styled(TextField)(() => ({ - width: '100%', +export const StyledTextField = styled(TextField, { +})(() => ({ + width: '100%', '& label.Mui-focused': { color: '#00D1FF', }, '& .MuiInput-underline:after': { borderBottomColor: '#00D1FF', }, + '& .MuiTextField-root': { + width: '100%' + }, '& .MuiOutlinedInput-root': { '& fieldset': { borderColor: 'gray', diff --git a/client/components/Parts/Fields/Multiline.tsx b/client/components/Parts/Fields/Multiline.tsx index 6109594d..ceffa149 100644 --- a/client/components/Parts/Fields/Multiline.tsx +++ b/client/components/Parts/Fields/Multiline.tsx @@ -21,27 +21,23 @@ interface MultilineFieldProps { export default function MultilineField(props: MultilineFieldProps) { const onFocus = props.onFocus || noop return ( -
- - {props.label} - - props.onChange(ev.target.value as any)} - onFocus={onFocus} - autoFocus={props.autoFocus} - required={props.required} - /> +
+ {props.label} + props.onChange(ev.target.value as any)} + onFocus={onFocus} + autoFocus={props.autoFocus} + required={props.required} + />
) } \ No newline at end of file diff --git a/client/components/Parts/Fields/YesNo.tsx b/client/components/Parts/Fields/YesNo.tsx index e43e2a3c..66a94b5b 100644 --- a/client/components/Parts/Fields/YesNo.tsx +++ b/client/components/Parts/Fields/YesNo.tsx @@ -14,14 +14,11 @@ interface YesNoFieldProps { export default function YesNoField(props: YesNoFieldProps) { const onFocus = props.onFocus || noop return ( -
- - {props.label} - +
+ {props.label}