feat(ui): hold shift to make nodes draggable from anywhere

This commit is contained in:
psychedelicious 2023-07-15 00:45:26 +10:00
parent 0257b4a611
commit 30e45eaf47
3 changed files with 7 additions and 3 deletions

View File

@ -53,14 +53,14 @@ export const InvocationComponent = memo((props: NodeProps<InvocationValue>) => {
description={template.description}
/>
<Flex
className="nopan"
className={'nopan'}
sx={{
cursor: 'auto',
flexDirection: 'column',
borderBottomRadius: 'md',
py: 2,
bg: 'base.200',
_dark: { bg: 'base.800' },
cursor: 'auto',
}}
>
<IAINodeOutputs nodeId={nodeId} outputs={outputs} template={template} />

View File

@ -2,6 +2,8 @@ import { Box, useToken } from '@chakra-ui/react';
import { NODE_MIN_WIDTH } from 'app/constants';
import { PropsWithChildren } from 'react';
import { DRAG_HANDLE_CLASSNAME } from '../hooks/useBuildInvocation';
import { useAppSelector } from 'app/store/storeHooks';
type NodeWrapperProps = PropsWithChildren & {
selected: boolean;
@ -13,8 +15,11 @@ const NodeWrapper = (props: NodeWrapperProps) => {
'dark-lg',
]);
const shift = useAppSelector((state) => state.hotkeys.shift);
return (
<Box
className={shift ? DRAG_HANDLE_CLASSNAME : 'nopan'}
sx={{
position: 'relative',
borderRadius: 'md',

View File

@ -23,7 +23,6 @@ const ProgressImageNode = (props: NodeProps<InvocationValue>) => {
<Flex
className="nopan"
sx={{
cursor: 'auto',
flexDirection: 'column',
borderBottomRadius: 'md',
p: 2,