From 2d0f9327377d68b53ce4a81137943141995b07a4 Mon Sep 17 00:00:00 2001 From: mickr777 <115216705+mickr777@users.noreply.github.com> Date: Wed, 26 Jul 2023 18:35:04 +1000 Subject: [PATCH] Lint Code --- .../components/fields/StringInputFieldComponent.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx index 858ac55f6d..48ca28f0fc 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/StringInputFieldComponent.tsx @@ -1,3 +1,4 @@ +import { memo, ChangeEvent } from 'react'; import { Textarea, Input } from '@chakra-ui/react'; import { useAppDispatch } from 'app/store/storeHooks'; import { fieldValueChanged } from 'features/nodes/store/nodesSlice'; @@ -5,9 +6,10 @@ import { StringInputFieldTemplate, StringInputFieldValue, } from 'features/nodes/types/types'; -import { ChangeEvent, memo } from 'react'; import { FieldComponentProps } from './types'; +const FIELD_PADDING = 20; + const StringInputFieldComponent = ( props: FieldComponentProps< StringInputFieldValue, @@ -31,12 +33,13 @@ const StringInputFieldComponent = ( ); }; - const textareaWidth = nodeWidth - 20; + const textareaWidth = nodeWidth - FIELD_PADDING; + + const textareaFieldNames = ['prompt', 'text']; return ( <> - {field.name.toLowerCase() === 'prompt' || - field.name.toLowerCase() === 'text' ? ( + {textareaFieldNames.includes(field.name.toLowerCase()) ? (