From 471eed91095884557c51e89afbeae03ee5e35c75 Mon Sep 17 00:00:00 2001 From: Filip Skaug <46749200+FilipSkaug@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:58:18 +0200 Subject: [PATCH] Vf 177 add tabs to header (#344) * vf-177 create tab component * vf-171 style tab bar * vf-171 rezise header * vf-171 add hjem to bar and remove logo button * vf-177 style login button * vf-177 center navbar * vf-177 lighten up header/tab bar and resize * vf-177 darkmode styling * vf-177 adjust to mobile view --- src/components/Header/AppHeader.tsx | 53 ++++++++----------------- src/components/Header/LoginButtons.tsx | 2 +- src/components/Header/Tab.tsx | 55 ++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 38 deletions(-) create mode 100644 src/components/Header/Tab.tsx diff --git a/src/components/Header/AppHeader.tsx b/src/components/Header/AppHeader.tsx index be18576b..dae15f89 100644 --- a/src/components/Header/AppHeader.tsx +++ b/src/components/Header/AppHeader.tsx @@ -1,61 +1,40 @@ import type React from "react"; import { useState } from "react"; -import { Link, NavLink } from "react-router-dom"; import LoginButtons from "./LoginButtons"; import LoginPopup from "./LoginPopup"; import MobileMenu from "./MobileMenu"; import UserAvatar from "./UserAvatar"; -import routes from "../../pages/public/routes"; - -const activeStyle: React.CSSProperties = { - fontWeight: "bold", - color: "#023874", -}; +import Tab from "@/components/Header/Tab"; const AppHeader = (): JSX.Element => { const [menuOpen, setMenuOpen] = useState(false); const [loginPopupVisible, setLoginPopupVisible] = useState(false); const isLoggedIn = false; - const navRoutes = routes.filter(route => route.path); - const linkElements = navRoutes.map((route) => ( - (isActive ? activeStyle : {})} - > - {route.name} - - )); return ( -
-
-
-
+
+
+
+
- vektorprogrammet logo -
+
-
- {linkElements} -
-
- {isLoggedIn ? ( - - ) : ( - - )} - {loginPopupVisible ? ( - - ) : null} -
+
+
+ {isLoggedIn ? ( + + ) : ( + + )} + {loginPopupVisible ? ( + + ) : null}
+ ); + })} +
+ ); +}; + +export default Tab; \ No newline at end of file