mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add informational popover base component and sample
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
import { PropsWithChildren } from 'react';
|
||||
import IAIInformationalPopover from '../../../common/components/IAIInformationalPopover';
|
||||
import InvokeAILogoImage from 'assets/images/logo.png';
|
||||
|
||||
export const ParamPositiveConditioningPopover = (props: PropsWithChildren) => {
|
||||
return (
|
||||
<IAIInformationalPopover
|
||||
heading="Prompt Box"
|
||||
paragraph="This is where you enter your prompt"
|
||||
buttonLabel="Learn more"
|
||||
buttonHref="http://google.com"
|
||||
image={InvokeAILogoImage}
|
||||
triggerComponent={props.children}
|
||||
/>
|
||||
);
|
||||
};
|
@ -1,4 +1,11 @@
|
||||
import { Box, FormControl, useDisclosure } from '@chakra-ui/react';
|
||||
import {
|
||||
Box,
|
||||
FormControl,
|
||||
Text,
|
||||
Tooltip,
|
||||
useDisclosure,
|
||||
Heading,
|
||||
} from '@chakra-ui/react';
|
||||
import { stateSelector } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import { ChangeEvent, KeyboardEvent, memo, useCallback, useRef } from 'react';
|
||||
@ -20,6 +27,9 @@ import { flushSync } from 'react-dom';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
|
||||
import IAIInformationalPopover from '../../../../../common/components/IAIInformationalPopover';
|
||||
import InvokeAILogoImage from 'assets/images/logo.png';
|
||||
import { ParamPositiveConditioningPopover } from '../../../../informationalPopovers/components/paramPositiveConditioning';
|
||||
|
||||
const promptInputSelector = createSelector(
|
||||
[stateSelector, activeTabNameSelector],
|
||||
@ -129,17 +139,19 @@ const ParamPositiveConditioning = () => {
|
||||
onClose={onClose}
|
||||
onSelect={handleSelectEmbedding}
|
||||
>
|
||||
<IAITextarea
|
||||
id="prompt"
|
||||
name="prompt"
|
||||
ref={promptRef}
|
||||
value={prompt}
|
||||
placeholder={t('parameters.positivePromptPlaceholder')}
|
||||
onChange={handleChangePrompt}
|
||||
onKeyDown={handleKeyDown}
|
||||
resize="vertical"
|
||||
minH={32}
|
||||
/>
|
||||
<ParamPositiveConditioningPopover>
|
||||
<IAITextarea
|
||||
id="prompt"
|
||||
name="prompt"
|
||||
ref={promptRef}
|
||||
value={prompt}
|
||||
placeholder={t('parameters.positivePromptPlaceholder')}
|
||||
onChange={handleChangePrompt}
|
||||
onKeyDown={handleKeyDown}
|
||||
resize="vertical"
|
||||
minH={32}
|
||||
/>
|
||||
</ParamPositiveConditioningPopover>
|
||||
</ParamEmbeddingPopover>
|
||||
</FormControl>
|
||||
{!isOpen && isEmbeddingEnabled && (
|
||||
|
Reference in New Issue
Block a user