feat(ui): remove galleryHeader in favor of projectUrl & projectName

This commit is contained in:
psychedelicious 2024-07-10 16:16:53 +10:00 committed by Kent Keirsey
parent 2edfb2356d
commit dfd94bbd0b
3 changed files with 20 additions and 14 deletions

View File

@ -7,11 +7,10 @@ import { $baseUrl } from 'app/store/nanostores/baseUrl';
import { $customNavComponent } from 'app/store/nanostores/customNavComponent'; import { $customNavComponent } from 'app/store/nanostores/customNavComponent';
import type { CustomStarUi } from 'app/store/nanostores/customStarUI'; import type { CustomStarUi } from 'app/store/nanostores/customStarUI';
import { $customStarUI } from 'app/store/nanostores/customStarUI'; import { $customStarUI } from 'app/store/nanostores/customStarUI';
import { $galleryHeader } from 'app/store/nanostores/galleryHeader';
import { $isDebugging } from 'app/store/nanostores/isDebugging'; import { $isDebugging } from 'app/store/nanostores/isDebugging';
import { $logo } from 'app/store/nanostores/logo'; import { $logo } from 'app/store/nanostores/logo';
import { $openAPISchemaUrl } from 'app/store/nanostores/openAPISchemaUrl'; import { $openAPISchemaUrl } from 'app/store/nanostores/openAPISchemaUrl';
import { $projectId } from 'app/store/nanostores/projectId'; import { $projectId, $projectName, $projectUrl } 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 { $workflowCategories } from 'app/store/nanostores/workflowCategories';
@ -37,7 +36,8 @@ interface Props extends PropsWithChildren {
customNavComponent?: ReactNode; customNavComponent?: ReactNode;
middleware?: Middleware[]; middleware?: Middleware[];
projectId?: string; projectId?: string;
galleryHeader?: ReactNode; projectName?: string;
projectUrl?: string;
queueId?: string; queueId?: string;
selectedImage?: { selectedImage?: {
imageName: string; imageName: string;
@ -58,7 +58,8 @@ const InvokeAIUI = ({
customNavComponent, customNavComponent,
middleware, middleware,
projectId, projectId,
galleryHeader, projectName,
projectUrl,
queueId, queueId,
selectedImage, selectedImage,
customStarUi, customStarUi,
@ -108,7 +109,7 @@ const InvokeAIUI = ({
$projectId.set(undefined); $projectId.set(undefined);
$queueId.set(DEFAULT_QUEUE_ID); $queueId.set(DEFAULT_QUEUE_ID);
}; };
}, [apiUrl, token, middleware, projectId, queueId]); }, [apiUrl, token, middleware, projectId, queueId, projectName, projectUrl]);
useEffect(() => { useEffect(() => {
if (customStarUi) { if (customStarUi) {
@ -141,14 +142,20 @@ const InvokeAIUI = ({
}, [openAPISchemaUrl]); }, [openAPISchemaUrl]);
useEffect(() => { useEffect(() => {
if (galleryHeader) { $projectName.set(projectName);
$galleryHeader.set(galleryHeader);
}
return () => { return () => {
$galleryHeader.set(undefined); $projectName.set(undefined);
}; };
}, [galleryHeader]); }, [projectName]);
useEffect(() => {
$projectUrl.set(projectUrl);
return () => {
$projectUrl.set(undefined);
};
}, [projectUrl]);
useEffect(() => { useEffect(() => {
if (logo) { if (logo) {

View File

@ -1,4 +0,0 @@
import { atom } from 'nanostores';
import type { ReactNode } from 'react';
export const $galleryHeader = atom<ReactNode | undefined>(undefined);

View File

@ -4,3 +4,6 @@ import { atom } from 'nanostores';
* The optional project-id header. * The optional project-id header.
*/ */
export const $projectId = atom<string | undefined>(); export const $projectId = atom<string | undefined>();
export const $projectName = atom<string | undefined>();
export const $projectUrl = atom<string | undefined>();