menu moved to const

This commit is contained in:
tmshv committed 2026-04-13 02:14:31 +03:00
1 parent ccca4237ac
commit 3172e9c91e
9 files changed
+30 -69

No files matched your search

-3
View File
@@ -2,9 +2,7 @@
import s from "./app.module.css"
import { useContext } from "react"
import { Wrapper } from "../Wrapper"
import { MenuContext } from "@/context/MenuContext"
import { Footer } from "../Footer"
import { Content } from "../Content"
import { Breadcrumbs } from "../Breadcrumbs"
@@ -42,7 +40,6 @@ export function App({ showAuthor = false, ...props }: AppProps) {
const hideBreadcrumbs = useMobile()
const accessibility = useAccessibility()
const pathname = usePathname()
const menu = useContext(MenuContext)
return (
<Wrapper
@@ -1,11 +1,10 @@
import { Menu } from "../Menu"
import { useContext } from "react"
import { MenuContext } from "@/context/MenuContext"
import { Box } from "@/ui/Box"
import HudozkaLogo from "../HudozkaLogo"
import Link from "next/link"
import { AccessibilityButton } from "../AccessibilityButton"
import { Spacer } from "../Spacer"
import { menu } from "@/const"
export type DesktopNavigationProps = {
className?: string
@@ -13,8 +12,6 @@ export type DesktopNavigationProps = {
}
export function DesktopNavigation({ style, className }: DesktopNavigationProps) {
const menu = useContext(MenuContext)
return (
<Box wrap className={className} gap={"var(--size-s)"} style={style}>
<Link href="/">
@@ -30,4 +27,3 @@ export function DesktopNavigation({ style, className }: DesktopNavigationProps)
</Box>
)
}
@@ -3,8 +3,7 @@
import s from "./nav.module.css"
import { Menu } from "../Menu"
import { useCallback, useContext, useEffect, useRef } from "react"
import { MenuContext } from "@/context/MenuContext"
import { useCallback, useEffect, useRef } from "react"
import { Box } from "@/ui/Box"
import { Spacer } from "../Spacer"
import HudozkaLogo from "../HudozkaLogo"
@@ -12,6 +11,7 @@ import { HudozkaTitle } from "../HudozkaTitle"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { HiOutlineMenuAlt4, HiOutlineX } from "react-icons/hi"
import { menu } from "@/const"
export type MobileNavigationProps = {
className?: string
@@ -19,7 +19,6 @@ export type MobileNavigationProps = {
}
export function MobileNavigation({ className, style }: MobileNavigationProps) {
const menu = useContext(MenuContext)
const detailsRef = useRef<HTMLDetailsElement>(null)
const pathname = usePathname()
-17
View File
@@ -1,17 +0,0 @@
"use client"
import { MenuContext } from "@/context/MenuContext"
import type { MenuItem } from "@/types"
export type ProvidersProps = {
menu: MenuItem[]
children: React.ReactNode
}
export function Providers({ menu, children }: ProvidersProps) {
return (
<MenuContext.Provider value={menu}>
{children}
</MenuContext.Provider>
)
}