2
0

🛠️ Adapt Cypress to Turbo Repo

This commit is contained in:
Baptiste Arnaud
2021-12-17 07:54:12 +01:00
parent 772b16c6ce
commit a54e42f255
13 changed files with 57 additions and 128 deletions

View File

@ -10,7 +10,6 @@ import { StartBlockNode } from './BlockNode/StartBlockNode'
const Graph = () => {
const { draggedStepType, setDraggedStepType, draggedStep, setDraggedStep } =
useDnd()
const graphRef = useRef<HTMLDivElement | null>(null)
const graphContainerRef = useRef<HTMLDivElement | null>(null)
const { typebot } = useTypebot()
const {
@ -59,8 +58,8 @@ const Graph = () => {
addNewBlock({
step: draggedStep,
type: draggedStepType,
x: e.x - graphPosition.x - blockWidth / 3,
y: e.y - graphPosition.y - 20,
x: e.clientX - graphPosition.x - blockWidth / 3,
y: e.clientY - graphPosition.y - 20,
})
setDraggedStep(undefined)
setDraggedStepType(undefined)
@ -69,11 +68,10 @@ const Graph = () => {
if (!typebot) return <></>
return (
<Flex ref={graphContainerRef} pos="relative" flex="1" h="full">
<Flex ref={graphContainerRef} flex="1" h="full">
<Flex
ref={graphRef}
flex="1"
h="full"
boxSize={'200px'}
style={{
transform,
}}