mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-16 07:35:24 -05:00
There is a console error we can ignore when toggling gallery panel on canvas - this will be resolved in the next release of the resizable library
87 lines
2.3 KiB
TypeScript
87 lines
2.3 KiB
TypeScript
import { Flex } from '@chakra-ui/react';
|
|
import { useAppSelector } from 'app/store/storeHooks';
|
|
import { IAINoContentFallback } from 'common/components/IAIImageFallback';
|
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
import { memo } from 'react';
|
|
import { MdDeviceHub } from 'react-icons/md';
|
|
import 'reactflow/dist/style.css';
|
|
import AddNodePopover from './flow/AddNodePopover/AddNodePopover';
|
|
import { Flow } from './flow/Flow';
|
|
|
|
const NodeEditor = () => {
|
|
const isReady = useAppSelector((state) => state.nodes.isReady);
|
|
return (
|
|
<Flex
|
|
layerStyle="first"
|
|
sx={{
|
|
position: 'relative',
|
|
width: 'full',
|
|
height: 'full',
|
|
borderRadius: 'base',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
}}
|
|
>
|
|
<AnimatePresence>
|
|
{isReady && (
|
|
<motion.div
|
|
initial={{
|
|
opacity: 0,
|
|
}}
|
|
animate={{
|
|
opacity: 1,
|
|
transition: { duration: 0.2 },
|
|
}}
|
|
exit={{
|
|
opacity: 0,
|
|
transition: { duration: 0.2 },
|
|
}}
|
|
style={{ position: 'relative', width: '100%', height: '100%' }}
|
|
>
|
|
<Flow />
|
|
<AddNodePopover />
|
|
</motion.div>
|
|
)}
|
|
</AnimatePresence>
|
|
<AnimatePresence>
|
|
{!isReady && (
|
|
<motion.div
|
|
initial={{
|
|
opacity: 0,
|
|
}}
|
|
animate={{
|
|
opacity: 1,
|
|
transition: { duration: 0.2 },
|
|
}}
|
|
exit={{
|
|
opacity: 0,
|
|
transition: { duration: 0.2 },
|
|
}}
|
|
style={{ position: 'absolute', width: '100%', height: '100%' }}
|
|
>
|
|
<Flex
|
|
layerStyle="first"
|
|
sx={{
|
|
position: 'relative',
|
|
width: 'full',
|
|
height: 'full',
|
|
borderRadius: 'base',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
pointerEvents: 'none',
|
|
}}
|
|
>
|
|
<IAINoContentFallback
|
|
label="Loading Nodes..."
|
|
icon={MdDeviceHub}
|
|
/>
|
|
</Flex>
|
|
</motion.div>
|
|
)}
|
|
</AnimatePresence>
|
|
</Flex>
|
|
);
|
|
};
|
|
|
|
export default memo(NodeEditor);
|