This commit is contained in:
Mary Hipp 2024-01-26 16:46:26 -05:00 committed by psychedelicious
parent 418cdbabb7
commit b28fcc6be5
3 changed files with 10 additions and 7 deletions

View File

@ -14,17 +14,17 @@ import { $openAPISchemaUrl } from 'app/store/nanostores/openAPISchemaUrl';
import { $projectId } from 'app/store/nanostores/projectId'; import { $projectId } from 'app/store/nanostores/projectId';
import { $queueId, DEFAULT_QUEUE_ID } from 'app/store/nanostores/queueId'; import { $queueId, DEFAULT_QUEUE_ID } from 'app/store/nanostores/queueId';
import { $store } from 'app/store/nanostores/store'; import { $store } from 'app/store/nanostores/store';
import { $workflowCategories } from 'app/store/nanostores/workflowCategories';
import { createStore } from 'app/store/store'; import { createStore } from 'app/store/store';
import type { PartialAppConfig } from 'app/types/invokeai'; import type { PartialAppConfig } from 'app/types/invokeai';
import Loading from 'common/components/Loading/Loading'; import Loading from 'common/components/Loading/Loading';
import AppDndContext from 'features/dnd/components/AppDndContext'; import AppDndContext from 'features/dnd/components/AppDndContext';
import type { WorkflowCategory } from 'features/nodes/types/workflow';
import type { PropsWithChildren, ReactNode } from 'react'; import type { PropsWithChildren, ReactNode } from 'react';
import React, { lazy, memo, useEffect, useMemo } from 'react'; import React, { lazy, memo, useEffect, useMemo } from 'react';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { addMiddleware, resetMiddlewares } from 'redux-dynamic-middlewares'; import { addMiddleware, resetMiddlewares } from 'redux-dynamic-middlewares';
import type { ManagerOptions, SocketOptions } from 'socket.io-client'; import type { ManagerOptions, SocketOptions } from 'socket.io-client';
import { WorkflowCategory } from '../../features/nodes/types/workflow';
import { $workflowCategories } from '../store/nanostores/workflowCategories';
const App = lazy(() => import('./App')); const App = lazy(() => import('./App'));
const ThemeLocaleProvider = lazy(() => import('./ThemeLocaleProvider')); const ThemeLocaleProvider = lazy(() => import('./ThemeLocaleProvider'));

View File

@ -1,4 +1,7 @@
import type { WorkflowCategory } from 'features/nodes/types/workflow';
import { atom } from 'nanostores'; import { atom } from 'nanostores';
import { WorkflowCategory } from '../../../features/nodes/types/workflow';
export const $workflowCategories = atom<WorkflowCategory[]>(["user", "default"]); export const $workflowCategories = atom<WorkflowCategory[]>([
'user',
'default',
]);

View File

@ -11,10 +11,10 @@ import {
Input, Input,
InputGroup, InputGroup,
InputRightElement, InputRightElement,
Spacer,
} from '@invoke-ai/ui'; } from '@invoke-ai/ui';
import { useStore } from '@nanostores/react'; import { useStore } from '@nanostores/react';
import { $projectId } from 'app/store/nanostores/projectId'; import { $projectId } from 'app/store/nanostores/projectId';
import { $workflowCategories } from 'app/store/nanostores/workflowCategories';
import { import {
IAINoContentFallback, IAINoContentFallback,
IAINoContentFallbackWithSpinner, IAINoContentFallbackWithSpinner,
@ -34,7 +34,6 @@ import type {
} from 'services/api/types'; } from 'services/api/types';
import { useDebounce } from 'use-debounce'; import { useDebounce } from 'use-debounce';
import { z } from 'zod'; import { z } from 'zod';
import { $workflowCategories } from '../../../app/store/nanostores/workflowCategories';
const PER_PAGE = 10; const PER_PAGE = 10;
@ -170,11 +169,12 @@ const WorkflowLibraryList = () => {
h={16} h={16}
flexShrink={0} flexShrink={0}
flexGrow={0} flexGrow={0}
justifyContent={'space-between'} justifyContent="space-between"
> >
<ButtonGroup alignSelf="flex-end"> <ButtonGroup alignSelf="flex-end">
{workflowCategories.map((category) => ( {workflowCategories.map((category) => (
<Button <Button
key={category}
variant={selectedCategory === category ? undefined : 'ghost'} variant={selectedCategory === category ? undefined : 'ghost'}
onClick={handleSetCategory.bind(null, category)} onClick={handleSetCategory.bind(null, category)}
isChecked={selectedCategory === category} isChecked={selectedCategory === category}