Update MinimapPanel.tsx

This commit is contained in:
mickr777 2023-07-18 12:10:42 +10:00 committed by GitHub
parent c3a7e35ad8
commit 990f34aa15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,5 @@
import { RootState } from 'app/store/store';
import { useAppSelector } from 'app/store/storeHooks';
import { useColorModeValue } from '@chakra-ui/react'; import { useColorModeValue } from '@chakra-ui/react';
import { memo } from 'react'; import { memo } from 'react';
import { MiniMap } from 'reactflow'; import { MiniMap } from 'reactflow';
@ -12,6 +14,10 @@ const MinimapPanel = () => {
} }
); );
const shouldShowMinimapPanel = useAppSelector(
(state: RootState) => state.nodes.shouldShowMinimapPanel
);
const nodeColor = useColorModeValue( const nodeColor = useColorModeValue(
'var(--invokeai-colors-accent-300)', 'var(--invokeai-colors-accent-300)',
'var(--invokeai-colors-accent-700)' 'var(--invokeai-colors-accent-700)'
@ -23,6 +29,8 @@ const MinimapPanel = () => {
); );
return ( return (
<>
{shouldShowMinimapPanel && (
<MiniMap <MiniMap
nodeStrokeWidth={3} nodeStrokeWidth={3}
pannable pannable
@ -32,6 +40,8 @@ const MinimapPanel = () => {
nodeColor={nodeColor} nodeColor={nodeColor}
maskColor={maskColor} maskColor={maskColor}
/> />
)}
</>
); );
}; };