mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-19 09:54:24 -05:00
option to override logo component
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
/* eslint-disable i18next/no-literal-string */
|
||||
import { Image } from '@chakra-ui/react';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { $customAppInfo } from 'app/store/nanostores/customAppInfo';
|
||||
import InvokeLogoYellow from 'assets/images/invoke-key-ylw-sm.svg';
|
||||
import { InvText } from 'common/components/InvText/wrapper';
|
||||
import { InvTooltip } from 'common/components/InvTooltip/InvTooltip';
|
||||
import { memo, useMemo, useRef } from 'react';
|
||||
import { useGetAppVersionQuery } from 'services/api/endpoints/appInfo';
|
||||
import { $logo } from '../../../app/store/nanostores/logo';
|
||||
|
||||
const InvokeAILogoComponent = () => {
|
||||
const { data: appVersion } = useGetAppVersionQuery();
|
||||
const ref = useRef(null);
|
||||
const customAppInfo = useStore($customAppInfo);
|
||||
const logoOverride = useStore($logo);
|
||||
const tooltip = useMemo(() => {
|
||||
if (customAppInfo) {
|
||||
return <InvText fontWeight="semibold">{customAppInfo}</InvText>;
|
||||
}
|
||||
|
||||
if (appVersion) {
|
||||
return <InvText fontWeight="semibold">v{appVersion.version}</InvText>;
|
||||
}
|
||||
return null;
|
||||
}, [appVersion, customAppInfo]);
|
||||
}, [appVersion]);
|
||||
|
||||
if (logoOverride) {
|
||||
return logoOverride;
|
||||
}
|
||||
|
||||
return (
|
||||
<InvTooltip placement="right" label={tooltip} p={1} px={2} gutter={16}>
|
||||
|
||||
Reference in New Issue
Block a user