From 6ca62f0cda7ca252a2f074ddf2d418d9de998747 Mon Sep 17 00:00:00 2001 From: Frederic Henrichs Date: Mon, 9 Dec 2024 14:43:18 +0100 Subject: [PATCH] frontend/navbar: fix mobile menu and add icons. fix #125 --- frontend/src/components/Navbar.tsx | 35 +++++++++++++++++++------ frontend/src/main.scss | 42 ++++++++++++++++-------------- 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index fcbe348..25df46e 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -6,6 +6,8 @@ import { Navbar } from "react-bootstrap"; import { connected} from "./charger_list"; import Median from "median-js-bridge"; import i18n from "../i18n"; +import { useState } from "preact/hooks"; +import { LogOut, Server, User } from "react-feather"; export async function logout(logout_all: boolean) { await fetchClient.GET("/user/logout", {params:{query:{logout_all: logout_all}}, credentials: "same-origin"}); @@ -33,7 +35,8 @@ export function setAppNavigation() { export function CustomNavbar() { const { url } = useLocation(); - const {t} = useTranslation("", {useSuspense: false, keyPrefix: "navbar"}) + const [expanded, setExpanded] = useState(false); + const {t} = useTranslation("", {useSuspense: false, keyPrefix: "navbar"}); if (Median.isNativeApp()) { return setAppNavigation() @@ -41,19 +44,35 @@ export function CustomNavbar() { return ( -