mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore(ui): lint
This commit is contained in:
parent
ee6df5852a
commit
727f1638d7
@ -1,4 +1,4 @@
|
|||||||
import { ChakraProvider, extendTheme, useColorMode } from '@chakra-ui/react';
|
import { ChakraProvider, extendTheme } from '@chakra-ui/react';
|
||||||
import { ReactNode, useEffect } from 'react';
|
import { ReactNode, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { theme as invokeAITheme } from 'theme/theme';
|
import { theme as invokeAITheme } from 'theme/theme';
|
||||||
|
@ -72,10 +72,7 @@ export default function CurrentImagePreview() {
|
|||||||
maxHeight: APP_METADATA_HEIGHT,
|
maxHeight: APP_METADATA_HEIGHT,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ImageMetadataViewer
|
<ImageMetadataViewer image={imageToDisplay} />
|
||||||
image={imageToDisplay}
|
|
||||||
styleClass="current-image-metadata"
|
|
||||||
/>
|
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
@ -45,7 +45,6 @@ import { useHotkeys } from 'react-hotkeys-hook';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { FaCopy } from 'react-icons/fa';
|
import { FaCopy } from 'react-icons/fa';
|
||||||
import { IoArrowUndoCircleOutline } from 'react-icons/io5';
|
import { IoArrowUndoCircleOutline } from 'react-icons/io5';
|
||||||
import { APP_METADATA_HEIGHT } from 'theme/util/constants';
|
|
||||||
|
|
||||||
type MetadataItemProps = {
|
type MetadataItemProps = {
|
||||||
isLink?: boolean;
|
isLink?: boolean;
|
||||||
@ -115,7 +114,6 @@ const MetadataItem = ({
|
|||||||
|
|
||||||
type ImageMetadataViewerProps = {
|
type ImageMetadataViewerProps = {
|
||||||
image: InvokeAI.Image;
|
image: InvokeAI.Image;
|
||||||
styleClass?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: I don't know if this is needed.
|
// TODO: I don't know if this is needed.
|
||||||
@ -130,8 +128,7 @@ const memoEqualityCheck = (
|
|||||||
* Image metadata viewer overlays currently selected image and provides
|
* Image metadata viewer overlays currently selected image and provides
|
||||||
* access to any of its metadata for use in processing.
|
* access to any of its metadata for use in processing.
|
||||||
*/
|
*/
|
||||||
const ImageMetadataViewer = memo(
|
const ImageMetadataViewer = memo(({ image }: ImageMetadataViewerProps) => {
|
||||||
({ image, styleClass }: ImageMetadataViewerProps) => {
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const setBothPrompts = useSetBothPrompts();
|
const setBothPrompts = useSetBothPrompts();
|
||||||
@ -197,10 +194,7 @@ const ImageMetadataViewer = memo(
|
|||||||
<>
|
<>
|
||||||
{type && <MetadataItem label="Generation type" value={type} />}
|
{type && <MetadataItem label="Generation type" value={type} />}
|
||||||
{image.metadata?.model_weights && (
|
{image.metadata?.model_weights && (
|
||||||
<MetadataItem
|
<MetadataItem label="Model" value={image.metadata.model_weights} />
|
||||||
label="Model"
|
|
||||||
value={image.metadata.model_weights}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
{['esrgan', 'gfpgan'].includes(type) && (
|
{['esrgan', 'gfpgan'].includes(type) && (
|
||||||
<MetadataItem label="Original image" value={orig_path} />
|
<MetadataItem label="Original image" value={orig_path} />
|
||||||
@ -455,9 +449,7 @@ const ImageMetadataViewer = memo(
|
|||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
},
|
}, memoEqualityCheck);
|
||||||
memoEqualityCheck
|
|
||||||
);
|
|
||||||
|
|
||||||
ImageMetadataViewer.displayName = 'ImageMetadataViewer';
|
ImageMetadataViewer.displayName = 'ImageMetadataViewer';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Box, chakra, Flex } from '@chakra-ui/react';
|
import { Box, Flex } from '@chakra-ui/react';
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store';
|
import { RootState } from 'app/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/storeHooks';
|
||||||
@ -12,7 +12,6 @@ import { uiSelector } from 'features/ui/store/uiSelectors';
|
|||||||
import { AnimatePresence, motion } from 'framer-motion';
|
import { AnimatePresence, motion } from 'framer-motion';
|
||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { BiExit } from 'react-icons/bi';
|
import { BiExit } from 'react-icons/bi';
|
||||||
import { TransformWrapper } from 'react-zoom-pan-pinch';
|
import { TransformWrapper } from 'react-zoom-pan-pinch';
|
||||||
import { PROGRESS_BAR_THICKNESS } from 'theme/util/constants';
|
import { PROGRESS_BAR_THICKNESS } from 'theme/util/constants';
|
||||||
@ -38,11 +37,8 @@ export const lightboxSelector = createSelector(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const ChakraMotionBox = chakra(motion.div);
|
|
||||||
|
|
||||||
export default function Lightbox() {
|
export default function Lightbox() {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { t } = useTranslation();
|
|
||||||
const isLightBoxOpen = useAppSelector(
|
const isLightBoxOpen = useAppSelector(
|
||||||
(state: RootState) => state.lightbox.isLightboxOpen
|
(state: RootState) => state.lightbox.isLightboxOpen
|
||||||
);
|
);
|
||||||
|
@ -14,7 +14,6 @@ import { useAppDispatch, useAppSelector } from 'app/storeHooks';
|
|||||||
import NodesWIP from 'common/components/WorkInProgress/NodesWIP';
|
import NodesWIP from 'common/components/WorkInProgress/NodesWIP';
|
||||||
import { PostProcessingWIP } from 'common/components/WorkInProgress/PostProcessingWIP';
|
import { PostProcessingWIP } from 'common/components/WorkInProgress/PostProcessingWIP';
|
||||||
import TrainingWIP from 'common/components/WorkInProgress/Training';
|
import TrainingWIP from 'common/components/WorkInProgress/Training';
|
||||||
import Lightbox from 'features/lightbox/components/Lightbox';
|
|
||||||
import { setIsLightboxOpen } from 'features/lightbox/store/lightboxSlice';
|
import { setIsLightboxOpen } from 'features/lightbox/store/lightboxSlice';
|
||||||
import { InvokeTabName } from 'features/ui/store/tabMap';
|
import { InvokeTabName } from 'features/ui/store/tabMap';
|
||||||
import { setActiveTab, togglePanels } from 'features/ui/store/uiSlice';
|
import { setActiveTab, togglePanels } from 'features/ui/store/uiSlice';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Flex } from '@chakra-ui/layout';
|
import { Flex } from '@chakra-ui/layout';
|
||||||
import { RootState } from 'app/store';
|
|
||||||
import { useAppDispatch, useAppSelector } from 'app/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/storeHooks';
|
||||||
import IAIIconButton from 'common/components/IAIIconButton';
|
import IAIIconButton from 'common/components/IAIIconButton';
|
||||||
import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale';
|
import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user