From 4dc821bf7331cb71eda350bdcfad0b2ed90146f0 Mon Sep 17 00:00:00 2001 From: jude Date: Sun, 3 Dec 2023 16:39:08 +0000 Subject: [PATCH] Show/hide mobile sidebar --- index.html | 27 ------------ src/components/Sidebar/MobileSidebar.tsx | 53 ++++++++++++++++++++++-- src/components/Sidebar/index.tsx | 1 - 3 files changed, 50 insertions(+), 31 deletions(-) diff --git a/index.html b/index.html index f3e5d8c..3a1302b 100644 --- a/index.html +++ b/index.html @@ -29,33 +29,6 @@ -
diff --git a/src/components/Sidebar/MobileSidebar.tsx b/src/components/Sidebar/MobileSidebar.tsx index 8fad2f9..e8f0333 100644 --- a/src/components/Sidebar/MobileSidebar.tsx +++ b/src/components/Sidebar/MobileSidebar.tsx @@ -1,7 +1,54 @@ +import { useState } from "preact/hooks"; + export const MobileSidebar = ({ children }) => { + const [sidebarOpen, setSidebarOpen] = useState(false); + return ( -
- {children} -
+ <> + +
+ {children} +
+ ); }; diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index 780af2a..a77350c 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -5,7 +5,6 @@ import { Brand } from "./Brand"; import { Wave } from "./Wave"; import { GuildEntry } from "./GuildEntry"; import { fetchUserGuilds, GuildInfo } from "../../api"; -import { useState } from "preact/hooks"; import { TimezonePicker } from "../TimezonePicker"; import { Import } from "../Import";