From e803426e01e289a29e75d2c902d030c8f70b0d44 Mon Sep 17 00:00:00 2001 From: Saimon8420 Date: Sun, 9 Feb 2025 11:36:11 +0600 Subject: [PATCH] new design added --- public/assets/svgs/Group 25403.svg | 49 --------------------------- src/components/Canvas/Canvas.jsx | 13 ++++--- src/components/Panel/ProjectPanel.jsx | 20 +++++++---- 3 files changed, 21 insertions(+), 61 deletions(-) delete mode 100644 public/assets/svgs/Group 25403.svg diff --git a/public/assets/svgs/Group 25403.svg b/public/assets/svgs/Group 25403.svg deleted file mode 100644 index b2d1937..0000000 --- a/public/assets/svgs/Group 25403.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/Canvas/Canvas.jsx b/src/components/Canvas/Canvas.jsx index d30388f..a92af36 100644 --- a/src/components/Canvas/Canvas.jsx +++ b/src/components/Canvas/Canvas.jsx @@ -17,15 +17,18 @@ export default function Canvas() { const handleZoom = useCallback( (newZoom) => { - const zoom = Math.min(Math.max(newZoom, 0), 100); + const zoom = Math.min(Math.max(newZoom, 50), 100); // Prevent zoom from going below 10 setZoomLevel(zoom); if (canvasRef.current && canvas) { const scale = zoom / 100; - // Update canvas dimensions - const newWidth = canvasRef.current.offsetWidth * scale; - const newHeight = canvasRef.current.offsetHeight * scale; + // Ensure minimum dimensions + const minWidth = 50; // Set a reasonable minimum width + const minHeight = 50; // Set a reasonable minimum height + + const newWidth = Math.max(canvasRef.current.offsetWidth * scale, minWidth); + const newHeight = Math.max(canvasRef.current.offsetHeight * scale, minHeight); canvas.setWidth(newWidth); canvas.setHeight(newHeight); @@ -238,7 +241,7 @@ export default function Canvas() { return (
{/* Canvas Container */} -
+
{ }); const Row = ({ index, style }) => { - const project = filteredProjects[index]; // Use filtered projects + const project = filteredProjects[index]; return ( -
-
navigate(`/${project.id}`)}> -

{project?.name}

-

{project?.description}

- each_project +
+
navigate(`/${project.id}`)} + > +

{project?.name}

+

{project?.description}

+ each_project
); }; + // Filter projects where preview_url is not empty or null const filteredProjects = projects?.data?.filter(project => project?.preview_url) || [];