mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): style minimap
This commit is contained in:
parent
05c939d41e
commit
06ac16a77d
@ -1,19 +1,12 @@
|
||||
import { Flex, chakra, useColorModeValue } from '@chakra-ui/react';
|
||||
import { RootState } from 'app/store/store';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { Flex, useColorModeValue } from '@chakra-ui/react';
|
||||
import { memo } from 'react';
|
||||
import { MiniMap } from 'reactflow';
|
||||
|
||||
const MinimapPanel = () => {
|
||||
const miniMapStyle = useColorModeValue(
|
||||
{
|
||||
background: 'var(--invokeai-colors-base-200)',
|
||||
},
|
||||
{
|
||||
background: 'var(--invokeai-colors-base-500)',
|
||||
}
|
||||
);
|
||||
const ChakraMiniMap = chakra(MiniMap);
|
||||
|
||||
const MinimapPanel = () => {
|
||||
const shouldShowMinimapPanel = useAppSelector(
|
||||
(state: RootState) => state.nodes.shouldShowMinimapPanel
|
||||
);
|
||||
@ -31,11 +24,21 @@ const MinimapPanel = () => {
|
||||
return (
|
||||
<Flex sx={{ gap: 2, position: 'absolute', bottom: 2, insetInlineEnd: 2 }}>
|
||||
{shouldShowMinimapPanel && (
|
||||
<MiniMap
|
||||
<ChakraMiniMap
|
||||
pannable
|
||||
zoomable
|
||||
nodeBorderRadius={15}
|
||||
style={miniMapStyle}
|
||||
sx={{
|
||||
m: '0 !important',
|
||||
backgroundColor: 'base.200 !important',
|
||||
borderRadius: 'base',
|
||||
_dark: {
|
||||
backgroundColor: 'base.500 !important',
|
||||
},
|
||||
svg: {
|
||||
borderRadius: 'inherit',
|
||||
},
|
||||
}}
|
||||
nodeColor={nodeColor}
|
||||
maskColor={maskColor}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user