From 8055a27f73792daacd75f5498786ed5a9253eafa Mon Sep 17 00:00:00 2001 From: realtradam Date: Sat, 22 Jun 2024 18:49:08 -0400 Subject: made mobile sidebar autohide when clicking away --- src/components/Layout.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 415e5f8..fd50710 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -23,11 +23,18 @@ export default function Layout ({userData}: userData) setSidebarClosed(!sidebarClosed); } }; + const handleSidebarClickaway = () => { + if(!sidebarInit) + { + setSidebarOpen(false); + setSidebarClosed(true); + } + }; return ( <>
-
+
@@ -41,9 +48,9 @@ export default function Layout ({userData}: userData) { userData.name ?
Logged in as:
{userData.name}
: Login with Github }
Adam
Malczewski
-
-
+
-- cgit v1.2.3