feat(ui): refactor base image uploading logic

This commit is contained in:
psychedelicious
2023-05-15 17:45:05 +10:00
parent 5e4457445f
commit e1e5266fc3
21 changed files with 213 additions and 126 deletions

View File

@ -1,6 +1,7 @@
import { FormControl, Textarea } from '@chakra-ui/react';
import { FormControl } from '@chakra-ui/react';
import type { RootState } from 'app/store/store';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import IAITextarea from 'common/components/IAITextarea';
import { setNegativePrompt } from 'features/parameters/store/generationSlice';
import { useTranslation } from 'react-i18next';
@ -14,7 +15,7 @@ const ParamNegativeConditioning = () => {
return (
<FormControl>
<Textarea
<IAITextarea
id="negativePrompt"
name="negativePrompt"
value={negativePrompt}

View File

@ -1,4 +1,4 @@
import { Box, FormControl, Textarea } from '@chakra-ui/react';
import { Box, FormControl } from '@chakra-ui/react';
import { RootState } from 'app/store/store';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { ChangeEvent, KeyboardEvent, useCallback, useRef } from 'react';
@ -16,6 +16,7 @@ import { isEqual } from 'lodash-es';
import { useHotkeys } from 'react-hotkeys-hook';
import { useTranslation } from 'react-i18next';
import { userInvoked } from 'app/store/actions';
import IAITextarea from 'common/components/IAITextarea';
const promptInputSelector = createSelector(
[(state: RootState) => state.generation, activeTabNameSelector],
@ -72,7 +73,7 @@ const ParamPositiveConditioning = () => {
<FormControl
isInvalid={prompt.length === 0 || Boolean(prompt.match(/^[\s\r\n]+$/))}
>
<Textarea
<IAITextarea
id="prompt"
name="prompt"
placeholder={t('parameters.promptPlaceholder')}