From 8c7eb767bc49abc4dd67e41ce85c47a5864ac6f6 Mon Sep 17 00:00:00 2001 From: Kentai Radiquum Date: Sat, 13 Jul 2024 23:00:25 +0500 Subject: [PATCH] feat: add login navbar link, hide some nav links on mobile --- app/components/Navbar/Navbar.jsx | 20 ++++++++++++++++++-- app/store/auth.js | 0 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/store/auth.js diff --git a/app/components/Navbar/Navbar.jsx b/app/components/Navbar/Navbar.jsx index 4fc026c..589a59e 100644 --- a/app/components/Navbar/Navbar.jsx +++ b/app/components/Navbar/Navbar.jsx @@ -4,6 +4,8 @@ import { usePathname } from "next/navigation"; export const Navbar = () => { const pathname = usePathname(); + + const isNotAuthorizedStyle = "text-gray-700" const navLinks = [ { id: 1, @@ -11,6 +13,8 @@ export const Navbar = () => { iconActive: "material-symbols--home", title: "Домашняя", href: "/", + withAuthOnly: false, + mobileMenu: false }, { id: 2, @@ -18,6 +22,8 @@ export const Navbar = () => { iconActive: "material-symbols--search", title: "Поиск", href: "/search", + withAuthOnly: false, + mobileMenu: false }, { id: 3, @@ -25,6 +31,8 @@ export const Navbar = () => { iconActive: "material-symbols--bookmarks", title: "Закладки", href: "/bookmarks", + withAuthOnly: true, + mobileMenu: true }, { id: 4, @@ -32,6 +40,8 @@ export const Navbar = () => { iconActive: "material-symbols--favorite", title: "Избранное", href: "/favorites", + withAuthOnly: true, + mobileMenu: true }, { id: 5, @@ -39,17 +49,23 @@ export const Navbar = () => { iconActive: "material-symbols--history", title: "История", href: "/history", + withAuthOnly: true, + mobileMenu: true }, ]; return (
-
+
+ + + Войти +
); diff --git a/app/store/auth.js b/app/store/auth.js new file mode 100644 index 0000000..e69de29