chore(store): cleanup

This commit is contained in:
moklick
2024-09-04 17:07:00 +02:00
parent aa248af495
commit 122f722742
3 changed files with 68 additions and 57 deletions

View File

@@ -15,6 +15,7 @@ import {
Panel,
useUpdateNodeInternals,
ReactFlowProvider,
CoordinateExtent,
} from '@xyflow/react';
import DebugNode from './DebugNode';
@@ -162,6 +163,11 @@ const nodeTypes = {
default: DebugNode,
};
const nodeExtent: CoordinateExtent = [
[0, 0],
[1000, 1000],
];
const Subflow = () => {
const [rfInstance, setRfInstance] = useState<ReactFlowInstance | null>(null);
const updateNodeInternals = useUpdateNodeInternals();
@@ -231,10 +237,7 @@ const Subflow = () => {
nodeTypes={nodeTypes}
fitView
nodeOrigin={[0, 0]}
nodeExtent={[
[0, 0],
[1000, 1000],
]}
nodeExtent={nodeExtent}
>
<MiniMap />
<Controls />
@@ -254,12 +257,7 @@ const Subflow = () => {
};
export default () => (
<ReactFlowProvider
nodeExtent={[
[0, 0],
[1000, 1000],
]}
>
<ReactFlowProvider nodeExtent={nodeExtent}>
<Subflow />
</ReactFlowProvider>
);