From 068c72662db3a1dbfa2e3410bbf8cb484cbb686e Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Sat, 25 Feb 2023 17:27:47 +0100 Subject: [PATCH] style: alpha4 style tweaks (#299) --- .../components/input/text-input/TextInput.tsx | 24 ++++++------- .../playback/PlaybackControl.module.scss | 5 +-- .../control/playback/PlaybackTimer.tsx | 11 ++++-- .../src/features/editors/Editor.module.scss | 5 +++ .../event-editor/EventEditor.module.scss | 4 +++ .../src/features/event-editor/EventEditor.tsx | 5 ++- .../client/src/features/info/Info.module.scss | 1 + apps/client/src/features/info/InfoNif.tsx | 12 ++----- .../event-block/EventBlock.module.scss | 2 +- .../features/viewers/backstage/Backstage.tsx | 4 +-- .../src/features/viewers/public/Public.scss | 1 + .../src/features/viewers/public/Public.tsx | 2 +- .../src/features/viewers/timer/Timer.scss | 2 +- .../src/features/viewers/timer/Timer.tsx | 34 +++++-------------- apps/client/src/theme/_ontimeColours.scss | 2 ++ 15 files changed, 55 insertions(+), 59 deletions(-) diff --git a/apps/client/src/common/components/input/text-input/TextInput.tsx b/apps/client/src/common/components/input/text-input/TextInput.tsx index 5533c1b40..7fa6c3c1f 100644 --- a/apps/client/src/common/components/input/text-input/TextInput.tsx +++ b/apps/client/src/common/components/input/text-input/TextInput.tsx @@ -6,7 +6,7 @@ import { Size } from '../../../models/Util.type'; import useReactiveTextInput from './useReactiveTextInput'; -interface TextInputProps { +interface BaseProps { isTextArea?: boolean; isFullHeight?: boolean; size?: Size; @@ -15,13 +15,18 @@ interface TextInputProps { submitHandler: (field: EventEditorSubmitActions, newValue: string) => void; } +interface TextAreaProps { + isTextArea: true; + resize?: 'horizontal' | 'vertical' | 'none'; +} + +type TextInputProps = BaseProps & TextAreaProps; + export default function TextInput(props: TextInputProps) { - const { isTextArea, isFullHeight, size = 'sm', field, initialText = '', submitHandler } = props; + const { isTextArea, isFullHeight, size = 'sm', field, initialText = '', submitHandler, resize = 'none' } = props; const inputRef = useRef(null); - const submitCallback = useCallback((newValue: string) => - submitHandler(field, newValue) - ,[field, submitHandler]); + const submitCallback = useCallback((newValue: string) => submitHandler(field, newValue), [field, submitHandler]); const textInputProps = useReactiveTextInput(initialText, submitCallback, { submitOnEnter: true }); const textAreaProps = useReactiveTextInput(initialText, submitCallback); @@ -30,18 +35,13 @@ export default function TextInput(props: TextInputProps) {