diff --git a/app/App.tsx b/app/App.tsx index e8c949c..bb81fc1 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -1,7 +1,7 @@ "use client"; import { useUserStore } from "./store/auth"; import { usePreferencesStore } from "./store/preferences"; -import { Navbar } from "./components/Navbar/NavbarUpdate"; +import { Navbar } from "./components/Navbar/Navbar"; import { Inter } from "next/font/google"; import { useEffect, useState } from "react"; import { Button, Modal } from "flowbite-react"; diff --git a/app/components/Navbar/NavbarUpdate.tsx b/app/components/Navbar/NavbarUpdate.tsx deleted file mode 100644 index 9ee4d76..0000000 --- a/app/components/Navbar/NavbarUpdate.tsx +++ /dev/null @@ -1,190 +0,0 @@ -"use client"; - -import Link from "next/link"; -import Image from "next/image"; -import { useUserStore } from "#/store/auth"; -import { usePathname } from "next/navigation"; -import { useState } from "react"; -import { SettingsModal } from "#/components/SettingsModal/SettingsModal"; -import { usePreferencesStore } from "#/store/preferences"; - -export const Navbar = () => { - const pathname = usePathname(); - const userStore = useUserStore(); - const [isSettingModalOpen, setIsSettingModalOpen] = useState(false); - const preferenceStore = usePreferencesStore(); - - const menuItems = [ - { - id: 1, - title: "Домашняя", - href: "/", - hrefInCategory: "/home", - icon: { - default: "material-symbols--home-outline", - active: "material-symbols--home", - }, - isAuthRequired: false, - isShownOnMobile: true, - }, - { - id: 2, - title: "Поиск", - href: "/search", - icon: { - default: "material-symbols--search", - active: "material-symbols--search", - }, - isAuthRequired: false, - isShownOnMobile: true, - }, - { - id: 3, - title: "Закладки", - href: "/bookmarks", - icon: { - default: "material-symbols--bookmarks-outline", - active: "material-symbols--bookmarks", - }, - isAuthRequired: true, - isShownOnMobile: true, - }, - { - id: 4, - title: "Избранное", - href: "/favorites", - icon: { - default: "material-symbols--favorite-outline", - active: "material-symbols--favorite", - }, - isAuthRequired: true, - isShownOnMobile: false, - }, - { - id: 5, - title: "Коллекции", - href: "/collections", - icon: { - default: "material-symbols--collections-bookmark-outline", - active: "material-symbols--collections-bookmark", - }, - isAuthRequired: true, - isShownOnMobile: false, - }, - { - id: 6, - title: "История", - href: "/history", - icon: { - default: "material-symbols--history", - active: "material-symbols--history", - }, - isAuthRequired: true, - isShownOnMobile: false, - }, - ]; - - return ( - <> -
-
-
- {menuItems.map((item) => { - return ( - - - - {item.title} - - - ); - })} -
-
- {!userStore.isAuth ? - - - - Войти - - - : <> - - - - {userStore.user.login} - - - - - - {userStore.user.login} - - - - } - - {userStore.isAuth && ( - - )} -
-
-
- - - ); -}; diff --git a/app/components/SettingsModal/SettingsModal.tsx b/app/components/SettingsModal/SettingsModal.tsx index 39ae318..6b1f976 100644 --- a/app/components/SettingsModal/SettingsModal.tsx +++ b/app/components/SettingsModal/SettingsModal.tsx @@ -27,13 +27,6 @@ const BookmarksCategory = { abandoned: "Заброшено", }; -const NavbarTitles = { - always: "Всегда", - links: "Только ссылки", - selected: "Только выбранные", - never: "Никогда", -} - export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { const preferenceStore = usePreferencesStore(); @@ -96,7 +89,7 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { checked={preferenceStore.params.skipToCategory.enabled} /> - {preferenceStore.params.skipToCategory.enabled ? + {preferenceStore.params.skipToCategory.enabled ? ( <>

@@ -161,33 +154,9 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {

- : ""} -
-

- Показывать название пункта в навигации -

- - {Object.keys(NavbarTitles).map((key: "always" | "links" | "selected" | "never") => { - return ( - - preferenceStore.setFlags({ - showNavbarTitles: key, - }) - } - > - {NavbarTitles[key]} - - ); - })} - -
+ ) : ( + "" + )}
diff --git a/app/pages/MobileMenuPage.tsx b/app/pages/MobileMenuPage.tsx index a075e2a..450e42b 100644 --- a/app/pages/MobileMenuPage.tsx +++ b/app/pages/MobileMenuPage.tsx @@ -81,7 +81,7 @@ export const MenuPage = () => {
- +
{
- +
{
- +
()( saveWatchHistory: true, showChangelog: true, enableAnalytics: true, - showNavbarTitles: "always", }, params: { isFirstLaunch: true,