From b31fe1cac1d7aaf8fa8efa1bf7fe3f6a1f40f04a Mon Sep 17 00:00:00 2001 From: "np.w" Date: Wed, 17 Feb 2021 10:16:00 -0600 Subject: [PATCH] hide menu on click --- client/src/box.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/box.js b/client/src/box.js index b9e91ba..24897aa 100644 --- a/client/src/box.js +++ b/client/src/box.js @@ -13,7 +13,14 @@ const Box = ({ boxData, boxHandler, itemHandler }) => { if (menu.current.contains(event.target)) return; setShowMenu(false); } - + const handleClickRemove = () => { + boxHandler.handleRemove(boxData._id); + setShowMenu(false); + } + const handleClickEdit = () => { + boxHandler.handleEdit(boxData._id); + setShowMenu(false); + } const [showMenu, setShowMenu] = useState(false); const handleBoxMenuClick = () => { setShowMenu(true); @@ -21,11 +28,11 @@ const Box = ({ boxData, boxHandler, itemHandler }) => { const moreMenu = () => { return (