tidy(ui): clean up unused code 4

variables, types and schemas
This commit is contained in:
psychedelicious
2024-02-27 17:46:13 +11:00
parent dc64089c9d
commit b661d93bd8
26 changed files with 72 additions and 217 deletions

View File

@ -2,11 +2,11 @@ import { Flex, Heading } from '@invoke-ai/ui-library';
import type { PropsWithChildren } from 'react';
import { memo } from 'react';
export type StickyScrollableHeadingProps = {
type StickyScrollableHeadingProps = {
title: string;
};
export const StickyScrollableHeading = memo((props: StickyScrollableHeadingProps) => {
const StickyScrollableHeading = memo((props: StickyScrollableHeadingProps) => {
return (
<Flex ps={2} pb={4} position="sticky" zIndex={1} top={0} bg="base.800">
<Heading size="sm">{props.title}</Heading>
@ -16,9 +16,9 @@ export const StickyScrollableHeading = memo((props: StickyScrollableHeadingProps
StickyScrollableHeading.displayName = 'StickyScrollableHeading';
export type StickyScrollableContentProps = PropsWithChildren;
type StickyScrollableContentProps = PropsWithChildren;
export const StickyScrollableContent = memo((props: StickyScrollableContentProps) => {
const StickyScrollableContent = memo((props: StickyScrollableContentProps) => {
return (
<Flex p={4} borderRadius="base" bg="base.750" flexDir="column" gap={4}>
{props.children}

View File

@ -14,7 +14,7 @@ const baseDimensionConfig: NumericalParameterConfig = {
coarseStep: 64,
};
export const initialConfigState: AppConfig = {
const initialConfigState: AppConfig = {
shouldUpdateImagesOnConnect: false,
shouldFetchMetadataFromApi: false,
disabledTabs: [],

View File

@ -24,7 +24,7 @@ import {
import type { Language, SystemState } from './types';
export const initialSystemState: SystemState = {
const initialSystemState: SystemState = {
_version: 1,
isConnected: false,
shouldConfirmOnDelete: true,
@ -199,7 +199,7 @@ const isAnyServerError = isAnyOf(socketInvocationError, socketSessionRetrievalEr
export const selectSystemSlice = (state: RootState) => state.system;
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
export const migrateSystemState = (state: any): any => {
const migrateSystemState = (state: any): any => {
if (!('_version' in state)) {
state._version = 1;
}

View File

@ -15,7 +15,7 @@ export type DenoiseProgress = {
percentage: number;
};
export const zLanguage = z.enum([
const zLanguage = z.enum([
'ar',
'az',
'de',
@ -58,11 +58,3 @@ export interface SystemState {
status: SystemStatus;
shouldEnableInformationalPopovers: boolean;
}
export const STATUS_TRANSLATION_KEYS: Record<SystemStatus, string> = {
CONNECTED: 'common.statusConnected',
DISCONNECTED: 'common.statusDisconnected',
PROCESSING: 'common.statusProcessing',
ERROR: 'common.statusError',
LOADING_MODEL: 'common.statusLoadingModel',
};