diff --git a/frontend/index.html b/frontend/index.html index 8989d4f..ca0383c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ Team Software Project -
+
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 876d91f..9beb0b5 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -10,10 +10,11 @@ import ResetPasswordPage from "./pages/ResetPasswordPage"; import CategoryPage from "./pages/CategoryPage"; import CategoriesPage from "./pages/AllCategoriesPage"; import ResultsPage from "./pages/ResultsPage"; -import { SidebarProvider } from "./context/SidebarContext"; +import { SidebarProvider, useSidebar } from "./context/SidebarContext"; import { QuickSettingsProvider } from "./context/QuickSettingsContext"; import StreamDashboardPage from "./pages/StreamDashboardPage"; import { Brightness } from "./context/BrightnessContext"; +import Sidebar from "./components/Navigation/Sidebar"; function App() { const [isLoggedIn, setIsLoggedIn] = useState(false); @@ -58,6 +59,7 @@ function App() { + {isLoggedIn && window.innerWidth > 900 && } { children: React.ReactNode; - navbarVariant?: "home" | "default"; + navbarVariant?: "home" | "no-navbar" | "default"; className?: string; style?: React.CSSProperties; } @@ -19,12 +19,12 @@ const DynamicPageContent: React.FC = ({ return (
- + {navbarVariant !== "no-navbar" && }
{children}
diff --git a/frontend/src/components/Layout/ListRow.tsx b/frontend/src/components/Layout/ListRow.tsx index 8c66010..ba10380 100644 --- a/frontend/src/components/Layout/ListRow.tsx +++ b/frontend/src/components/Layout/ListRow.tsx @@ -89,7 +89,7 @@ const ListRow = forwardRef< return (
= ({
Go on, have a...
-
+
G A N diff --git a/frontend/src/components/Navigation/Navbar.tsx b/frontend/src/components/Navigation/Navbar.tsx index a605fba..9ffc467 100644 --- a/frontend/src/components/Navigation/Navbar.tsx +++ b/frontend/src/components/Navigation/Navbar.tsx @@ -1,8 +1,6 @@ import React, { useEffect } from "react"; import Logo from "../Layout/Logo"; import Button, { ToggleButton } from "../Input/Button"; -import Sidebar from "./Sidebar"; -import { Sidebar as SidebarIcon } from "lucide-react"; import { LogIn as LogInIcon, LogOut as LogOutIcon, @@ -24,7 +22,7 @@ interface NavbarProps { const Navbar: React.FC = ({ variant = "default" }) => { const { isLoggedIn } = useAuth(); const { showAuthModal, setShowAuthModal } = useAuthModal(); - const { showSideBar, setShowSideBar } = useSidebar(); + const { showSideBar } = useSidebar(); const { showQuickSettings, setShowQuickSettings } = useQuickSettings(); const handleLogout = () => { @@ -41,23 +39,11 @@ const Navbar: React.FC = ({ variant = "default" }) => { setShowQuickSettings(!showQuickSettings); }; - const handleSideBar = () => { - setShowSideBar(!showSideBar); - }; - // Keyboard shortcut to toggle sidebar useEffect(() => { const handleKeyPress = (e: KeyboardEvent) => { - if ( - e.key === "s" && - document.activeElement == document.body && - isLoggedIn - ) { - handleSideBar(); - } - if (e.key === "q" && document.activeElement == document.body) { + if (e.key === "q" && document.activeElement == document.body) handleQuickSettings(); - } }; document.addEventListener("keydown", handleKeyPress); @@ -65,12 +51,12 @@ const Navbar: React.FC = ({ variant = "default" }) => { return () => { document.removeEventListener("keydown", handleKeyPress); }; - }, [showSideBar, showQuickSettings, setShowSideBar, isLoggedIn]); + }, [showQuickSettings]); return (