From 1aae38923ff34be7f5f020506ffe65233ec1dc51 Mon Sep 17 00:00:00 2001 From: Deveshi Dwivedi Date: Thu, 20 Jun 2024 13:02:10 +0530 Subject: [PATCH] update passing of x,y values --- modules/room/components/Canvas.tsx | 4 +--- modules/room/components/Minimap.tsx | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/room/components/Canvas.tsx b/modules/room/components/Canvas.tsx index f28e66b..86f6de6 100644 --- a/modules/room/components/Canvas.tsx +++ b/modules/room/components/Canvas.tsx @@ -87,7 +87,7 @@ const Canvas = () => { }, [drawing, ctx]); return ( -
+
{ /> diff --git a/modules/room/components/Minimap.tsx b/modules/room/components/Minimap.tsx index 4c67675..05d3476 100644 --- a/modules/room/components/Minimap.tsx +++ b/modules/room/components/Minimap.tsx @@ -3,16 +3,16 @@ import { useViewportSize } from "@/common/hooks/useViewportSize"; import { MotionValue, useMotionValue } from "framer-motion"; import {Dispatch, SetStateAction, forwardRef, useEffect, useRef} from "react"; import {motion} from "framer-motion"; +import { useBoardPosition } from "../hooks/useBoardPosition"; const Minimap = forwardRef< HTMLCanvasElement,{ - x: MotionValue; - y: MotionValue; dragging: boolean; setMovedMiniMap: Dispatch>; } ->(({x, y, dragging, setMovedMiniMap}, ref)=>{ +>(({ dragging, setMovedMiniMap}, ref)=>{ + const {x,y} = useBoardPosition(); const containerRef = useRef(null); const {width, height} = useViewportSize();