mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
hide workflow library buttons if feature is disabled
This commit is contained in:
@ -23,7 +23,8 @@ export type AppFeature =
|
||||
| 'resumeQueue'
|
||||
| 'prependQueue'
|
||||
| 'invocationCache'
|
||||
| 'bulkDownload';
|
||||
| 'bulkDownload'
|
||||
| 'workflowLibrary';
|
||||
|
||||
/**
|
||||
* A disable-able Stable Diffusion feature
|
||||
|
@ -5,8 +5,12 @@ import UploadWorkflowButton from 'features/workflowLibrary/components/LoadWorkfl
|
||||
import ResetWorkflowEditorButton from 'features/workflowLibrary/components/ResetWorkflowButton';
|
||||
import SaveWorkflowButton from 'features/workflowLibrary/components/SaveWorkflowButton';
|
||||
import SaveWorkflowAsButton from 'features/workflowLibrary/components/SaveWorkflowAsButton';
|
||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||
|
||||
const TopCenterPanel = () => {
|
||||
const isWorkflowLibraryEnabled =
|
||||
useFeatureStatus('workflowLibrary').isFeatureEnabled;
|
||||
|
||||
return (
|
||||
<Flex
|
||||
sx={{
|
||||
@ -19,8 +23,12 @@ const TopCenterPanel = () => {
|
||||
>
|
||||
<DownloadWorkflowButton />
|
||||
<UploadWorkflowButton />
|
||||
<SaveWorkflowButton />
|
||||
<SaveWorkflowAsButton />
|
||||
{isWorkflowLibraryEnabled && (
|
||||
<>
|
||||
<SaveWorkflowButton />
|
||||
<SaveWorkflowAsButton />
|
||||
</>
|
||||
)}
|
||||
<ResetWorkflowEditorButton />
|
||||
</Flex>
|
||||
);
|
||||
|
@ -2,11 +2,15 @@ import { Flex } from '@chakra-ui/react';
|
||||
import WorkflowLibraryButton from 'features/workflowLibrary/components/WorkflowLibraryButton';
|
||||
import { memo } from 'react';
|
||||
import WorkflowEditorSettings from './WorkflowEditorSettings';
|
||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||
|
||||
const TopRightPanel = () => {
|
||||
const isWorkflowLibraryEnabled =
|
||||
useFeatureStatus('workflowLibrary').isFeatureEnabled;
|
||||
|
||||
return (
|
||||
<Flex sx={{ gap: 2, position: 'absolute', top: 2, insetInlineEnd: 2 }}>
|
||||
<WorkflowLibraryButton />
|
||||
{isWorkflowLibraryEnabled && <WorkflowLibraryButton />}
|
||||
<WorkflowEditorSettings />
|
||||
</Flex>
|
||||
);
|
||||
|
Reference in New Issue
Block a user