Disabled zoom and pan when on view mode

This commit is contained in:
Lucas Oliveira 2023-08-15 12:29:19 -03:00
commit 8529c379e1

View file

@ -405,12 +405,19 @@ export default function Page({
className="theme-attribution" className="theme-attribution"
minZoom={0.01} minZoom={0.01}
maxZoom={8} maxZoom={8}
zoomOnDoubleClick={!view}
zoomOnScroll={!view}
zoomOnPinch={!view}
panOnDrag={!view}
panOnScroll={!view}
> >
<Background className="" /> <Background className="" />
<Controls {!view && (
className="bg-muted fill-foreground stroke-foreground text-primary <Controls
className="bg-muted fill-foreground stroke-foreground text-primary
[&>button]:border-b-border hover:[&>button]:bg-border" [&>button]:border-b-border hover:[&>button]:bg-border"
></Controls> ></Controls>
)}
</ReactFlow> </ReactFlow>
{!view && ( {!view && (
<Chat flow={flow} reactFlowInstance={reactFlowInstance} /> <Chat flow={flow} reactFlowInstance={reactFlowInstance} />