From 295444c730973170cf1140d6e51830c299c28b42 Mon Sep 17 00:00:00 2001
From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com>
Date: Fri, 30 Jun 2023 06:09:14 +1200
Subject: [PATCH] cleanup: Minor theme related cleanup
---
.../components/IAIMantineMultiSelect.tsx | 2 --
.../common/components/IAIMantineSelect.tsx | 1 -
.../canvas/components/IAICanvasGrid.tsx | 7 +---
.../ProcessButtons/CancelButton.tsx | 32 ++++++++-----------
.../SettingsModal/SettingsModal.tsx | 2 --
.../system/components/SiteHeaderMenu.tsx | 6 ++--
invokeai/frontend/web/src/index.ts | 13 ++++----
invokeai/frontend/web/src/theme/theme.ts | 2 +-
8 files changed, 24 insertions(+), 41 deletions(-)
diff --git a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx
index 0a324d3221..e62a7b34c3 100644
--- a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx
+++ b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx
@@ -14,7 +14,6 @@ const IAIMantineMultiSelect = (props: IAIMultiSelectProps) => {
base50,
base100,
base200,
- base250,
base300,
base400,
base500,
@@ -27,7 +26,6 @@ const IAIMantineMultiSelect = (props: IAIMultiSelectProps) => {
accent400,
accent500,
accent600,
- accent700,
} = useChakraThemeTokens();
const [boxShadow] = useToken('shadows', ['dark-lg']);
const { colorMode } = useColorMode();
diff --git a/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx
index 3638b59562..0ca4c2c04c 100644
--- a/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx
+++ b/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx
@@ -32,7 +32,6 @@ const IAIMantineSelect = (props: IAISelectProps) => {
accent400,
accent500,
accent600,
- accent700,
} = useChakraThemeTokens();
const { colorMode } = useColorMode();
diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx
index ccff28046d..1b97acba71 100644
--- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx
+++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx
@@ -1,8 +1,7 @@
// Grid drawing adapted from https://longviewcoder.com/2021/12/08/konva-a-better-grid/
-import { useColorMode, useColorModeValue, useToken } from '@chakra-ui/react';
+import { useColorMode, useToken } from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit';
-import { RootState } from 'app/store/store';
import { useAppSelector } from 'app/store/storeHooks';
import { canvasSelector } from 'features/canvas/store/canvasSelectors';
import { isEqual, range } from 'lodash-es';
@@ -24,9 +23,6 @@ const selector = createSelector(
);
const IAICanvasGrid = () => {
- const currentTheme = useAppSelector(
- (state: RootState) => state.ui.currentTheme
- );
const { stageScale, stageCoordinates, stageDimensions } =
useAppSelector(selector);
const { colorMode } = useColorMode();
@@ -112,7 +108,6 @@ const IAICanvasGrid = () => {
stageScale,
stageCoordinates,
stageDimensions,
- currentTheme,
unscale,
colorMode,
darkGridLineColor,
diff --git a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx
index e4f574c44d..bb6e7e862d 100644
--- a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx
+++ b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx
@@ -1,35 +1,32 @@
+import {
+ ButtonGroup,
+ ButtonProps,
+ ButtonSpinner,
+ Menu,
+ MenuButton,
+ MenuItemOption,
+ MenuList,
+ MenuOptionGroup,
+} from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
-import IAIIconButton, {
- IAIIconButtonProps,
-} from 'common/components/IAIIconButton';
+import IAIIconButton from 'common/components/IAIIconButton';
import { systemSelector } from 'features/system/store/systemSelectors';
import {
+ CancelStrategy,
SystemState,
cancelScheduled,
cancelTypeChanged,
- CancelStrategy,
} from 'features/system/store/systemSlice';
import { isEqual } from 'lodash-es';
-import { useCallback, memo, useMemo } from 'react';
-import {
- ButtonSpinner,
- ButtonGroup,
- Menu,
- MenuButton,
- MenuList,
- MenuOptionGroup,
- MenuItemOption,
- ButtonGroupProps,
- ButtonProps,
-} from '@chakra-ui/react';
+import { memo, useCallback, useMemo } from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import { useTranslation } from 'react-i18next';
import { MdCancel, MdCancelScheduleSend } from 'react-icons/md';
-import { sessionCanceled } from 'services/api/thunks/session';
import { ChevronDownIcon } from '@chakra-ui/icons';
+import { sessionCanceled } from 'services/api/thunks/session';
const cancelButtonSelector = createSelector(
systemSelector,
@@ -141,7 +138,6 @@ const CancelButton = (
}
paddingX={0}
diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx
index b55b890bd1..c9508bb5fe 100644
--- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx
+++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx
@@ -9,7 +9,6 @@ import {
ModalHeader,
ModalOverlay,
Text,
- useColorMode,
useDisclosure,
} from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit';
@@ -48,7 +47,6 @@ import {
import { useTranslation } from 'react-i18next';
import { LogLevelName } from 'roarr';
import SettingsSchedulers from './SettingsSchedulers';
-import { mode } from 'theme/util/mode';
const selector = createSelector(
[systemSelector, uiSelector],
diff --git a/invokeai/frontend/web/src/features/system/components/SiteHeaderMenu.tsx b/invokeai/frontend/web/src/features/system/components/SiteHeaderMenu.tsx
index ddb18cb8d7..fc64f0275b 100644
--- a/invokeai/frontend/web/src/features/system/components/SiteHeaderMenu.tsx
+++ b/invokeai/frontend/web/src/features/system/components/SiteHeaderMenu.tsx
@@ -1,12 +1,12 @@
import { Flex, Link } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
-import { FaCube, FaKeyboard, FaBug, FaGithub, FaDiscord } from 'react-icons/fa';
+import { FaBug, FaCube, FaDiscord, FaGithub, FaKeyboard } from 'react-icons/fa';
import { MdSettings } from 'react-icons/md';
import HotkeysModal from './HotkeysModal/HotkeysModal';
import LanguagePicker from './LanguagePicker';
import ModelManagerModal from './ModelManager/ModelManagerModal';
import SettingsModal from './SettingsModal/SettingsModal';
-import ThemeChanger from './ThemeChanger';
+
import IAIIconButton from 'common/components/IAIIconButton';
import { useFeatureStatus } from '../hooks/useFeatureStatus';
@@ -53,8 +53,6 @@ const SiteHeaderMenu = () => {
/>
-
-
{isLocalizationEnabled && }
{isBugLinkEnabled && (
diff --git a/invokeai/frontend/web/src/index.ts b/invokeai/frontend/web/src/index.ts
index 274f9d5a0b..a2ce849cfd 100644
--- a/invokeai/frontend/web/src/index.ts
+++ b/invokeai/frontend/web/src/index.ts
@@ -1,9 +1,8 @@
-export { default as InvokeAiLogoComponent } from './features/system/components/InvokeAILogoComponent';
-export { default as ThemeChanger } from './features/system/components/ThemeChanger';
-export { default as IAIPopover } from './common/components/IAIPopover';
-export { default as IAIIconButton } from './common/components/IAIIconButton';
-export { default as SettingsModal } from './features/system/components/SettingsModal/SettingsModal';
-export { default as StatusIndicator } from './features/system/components/StatusIndicator';
-export { default as ModelSelect } from './features/system/components/ModelSelect';
export { default as InvokeAIUI } from './app/components/InvokeAIUI';
export type { PartialAppConfig } from './app/types/invokeai';
+export { default as IAIIconButton } from './common/components/IAIIconButton';
+export { default as IAIPopover } from './common/components/IAIPopover';
+export { default as InvokeAiLogoComponent } from './features/system/components/InvokeAILogoComponent';
+export { default as ModelSelect } from './features/system/components/ModelSelect';
+export { default as SettingsModal } from './features/system/components/SettingsModal/SettingsModal';
+export { default as StatusIndicator } from './features/system/components/StatusIndicator';
diff --git a/invokeai/frontend/web/src/theme/theme.ts b/invokeai/frontend/web/src/theme/theme.ts
index de7638a4ca..76b4aaaacc 100644
--- a/invokeai/frontend/web/src/theme/theme.ts
+++ b/invokeai/frontend/web/src/theme/theme.ts
@@ -44,7 +44,7 @@ export const theme: ThemeOverride = {
},
},
styles: {
- global: (props) => ({
+ global: () => ({
layerStyle: 'body',
'*': { ...no_scrollbar },
}),