From 4bca57536df646d640eba9769ed53877e549c592 Mon Sep 17 00:00:00 2001 From: Nick Savage Date: Sat, 4 Jan 2025 17:29:09 -0500 Subject: [PATCH] admin: admin page improvements --- .../src/pages/admin/AdminPage.tsx | 47 +++++++++++++++++-- .../src/pages/admin/AdminUserIndex.tsx | 18 ++----- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/zettelkasten-front/src/pages/admin/AdminPage.tsx b/zettelkasten-front/src/pages/admin/AdminPage.tsx index 1e928f7..07becd7 100644 --- a/zettelkasten-front/src/pages/admin/AdminPage.tsx +++ b/zettelkasten-front/src/pages/admin/AdminPage.tsx @@ -1,6 +1,7 @@ -import React, { useEffect } from "react"; +import React, { useEffect, useState } from "react"; import { useAuth } from "../../contexts/AuthContext"; import { useNavigate, Link } from "react-router-dom"; +import { MenuIcon } from "../../assets/icons/MenuIcon"; import { AdminUserIndex } from "./AdminUserIndex"; import { AdminUserDetailPage } from "./AdminUserDetailPage"; @@ -14,6 +15,7 @@ import { Routes, Route } from "react-router-dom"; export function Admin() { const { isAdmin, isLoading } = useAuth(); const navigate = useNavigate(); + const [isSidebarOpen, setIsSidebarOpen] = useState(false); useEffect(() => { if (!isLoading && !isAdmin) { @@ -35,8 +37,42 @@ export function Admin() { return (
- {/* Fixed Sidebar */} -
+ {/* Mobile Menu Button */} + + + {/* Mobile Backdrop */} + {isSidebarOpen && ( +
setIsSidebarOpen(false)} + /> + )} + + {/* Sidebar */} +