handleAddShape("rectangle")}
- >
-
-
- handleAddShape("ellipse")}
+ aria-label="open to select a shape"
+ onClick={handleClickShapesButton}
>
-
-
- handleAddShape("line")}
- >
-
+
{/* line weight */}
@@ -142,6 +146,7 @@ function Toolbar({
+ {/* colorPickerPopover */}
+ {/* lineWeightPopover */}
+
+ {/* shapesPopover */}
+
+ {/* shapes */}
+ handleAddShape("rectangle")}
+ >
+
+
+ handleAddShape("ellipse")}
+ >
+
+
+ handleAddShape("line")}
+ >
+
+
+
);
}
From ecd4afb677624b6ec02b83cd15168c12f47e6923 Mon Sep 17 00:00:00 2001
From: Leo Hong <5917188+low-earth-orbit@users.noreply.github.com>
Date: Tue, 27 Aug 2024 20:06:22 -0300
Subject: [PATCH 6/7] Close shapes popover upon selecting a shape
---
components/Toolbar.tsx | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/components/Toolbar.tsx b/components/Toolbar.tsx
index 38cb3e6..b2d2263 100644
--- a/components/Toolbar.tsx
+++ b/components/Toolbar.tsx
@@ -212,19 +212,28 @@ function Toolbar({
{/* shapes */}