22
33import { useEffect } from "react" ;
44import { usePathname } from "next/navigation" ;
5- import { useNavigation } from "@/app/_components/main_frame/navigation-context" ;
6- import { Disclosure , DisclosureButton , DisclosurePanel } from '@headlessui/react' ;
7- import { Bars3Icon , XMarkIcon } from '@heroicons/react/24/outline' ;
8- import { ProfileLogoSVG } from "@/app/_components/main_frame/icons_svg" ;
5+ import { Disclosure , DisclosureButton , DisclosurePanel , Menu , MenuButton , MenuItem , MenuItems } from "@headlessui/react" ;
6+ import { Bars3Icon , BellIcon , XMarkIcon } from "@heroicons/react/24/outline" ;
97import { HomeWithTextIcon , BlogWithTextIcon , TopicWithTextIcon , ResearchWithTextIcon } from "@/app/_components/main_frame/icons_svg" ;
8+ import { ProfileLogoSVG } from "@/app/_components/main_frame/icons_svg" ;
9+ import { useNavigation } from "@/app/_components/main_frame/navigation-context" ;
10+ import { TKOKHING_LOGO_SVG_URL } from "@/lib/constants" ;
11+ import { ThemeSwitcher } from "@/app/_components/main_frame/theme-switcher" ;
12+ import FontSizeDropdown from "@/app/_components/main_frame/font-size-button" ;
13+
14+ const user = {
15+ name : 'tkokhing' ,
16+ telegram : '@tkokhing' ,
17+ imageUrl : TKOKHING_LOGO_SVG_URL ,
18+ } ;
19+
20+ const userFontPreference = [
21+ { name : 'Your Profile' , href : '#' } ,
22+ { name : 'Settings' , href : '#' } ,
23+ { name : 'Sign out' , href : '#' } ,
24+ ] ;
1025
1126const navigation = [
1227 { name : 'Home' , href : '/' , icon : HomeWithTextIcon } ,
@@ -52,42 +67,51 @@ export default function Navigationbar() {
5267 } , [ pathname , setSelected ] ) ;
5368
5469 return (
55- < section className = "mt-1 mb-16 md:mb-12 min-h-full" >
56- < Disclosure as = "nav" >
57- < div className = "mx-auto max-w-7xl px-4 sm:px-6 lg:px-8" >
58- < div className = "flex h-30 items-center" >
59- < div className = "shrink-0 flex size-48" >
60- < ProfileLogoSVG />
70+ < div className = "min-h-full" >
71+ < Disclosure as = "nav" className = "mt-3 mb-16 md:mb-12" >
72+ < div className = "container mx-auto px-5 sm:px-6 lg:px-8 " >
73+ < div className = "flex h-16 items-center justify-between" >
74+ < div className = "flex items-center" >
75+ < div className = "shrink-0 flex size-48" >
76+ < ProfileLogoSVG />
77+ </ div >
78+ < div className = "hidden md:block" >
79+ < div className = "ml-10 flex items-baseline space-x-4" >
80+ { navigation . map ( ( item ) => (
81+ < a
82+ key = { item . name }
83+ href = { item . href }
84+ aria-label = "NavigationBar"
85+ aria-current = { selected === item . name ? 'page' : undefined }
86+ className = { classNames (
87+ selected === item . name ? 'bg-gray-700 dark:bg-gray-600' : 'text-sky-800 hover:bg-gray-500' ,
88+ 'rounded-md px-3 py-2'
89+ ) }
90+ onClick = { ( ) => setSelected ( item . name ) }
91+ >
92+ < item . icon aria-hidden = "true" />
93+ </ a >
94+ ) ) }
95+ </ div >
96+ </ div >
6197 </ div >
6298 < div className = "hidden md:block" >
63- < div className = "ml-10 flex items-baseline space-x-4" >
64- { navigation . map ( ( item ) => (
65- < a
66- key = { item . name }
67- href = { item . href }
68- aria-label = "NavigationBar"
69- aria-current = { selected === item . name ? 'page' : undefined }
70- className = { classNames (
71- selected === item . name ? 'bg-gray-700 dark:bg-gray-600' : 'text-sky-800 hover:bg-gray-500' ,
72- 'rounded-md px-3 py-2'
73- ) }
74- onClick = { ( ) => setSelected ( item . name ) }
75- >
76- < item . icon aria-hidden = "true" />
77- </ a >
78- ) ) }
99+ < div className = "space-x-8 flex items-center px-8 md:ml-6" >
100+ < FontSizeDropdown />
101+ < div className = "" >
102+ < ThemeSwitcher />
103+ </ div >
79104 </ div >
80105 </ div >
81- </ div >
82-
83- < div className = "-mr-2 flex md:hidden" >
84- { /* Mobile menu button */ }
85- < DisclosureButton className = "group relative inline-flex items-center justify-center rounded-md bg-gray-800 p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800" >
86- < span className = "absolute -inset-0.5" />
87- < span className = "sr-only" > Open main menu</ span >
88- < Bars3Icon aria-hidden = "true" className = "block size-6 group-data-[open]:hidden" />
89- < XMarkIcon aria-hidden = "true" className = "hidden size-6 group-data-[open]:block" />
90- </ DisclosureButton >
106+ < div className = "-mr-2 flex md:hidden" >
107+ { /* Mobile menu button */ }
108+ < DisclosureButton className = "group relative inline-flex items-center justify-center rounded-md bg-gray-800 p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800" >
109+ < span className = "absolute -inset-0.5" />
110+ < span className = "sr-only" > Open main menu</ span >
111+ < Bars3Icon aria-hidden = "true" className = "block size-6 group-data-[open]:hidden" />
112+ < XMarkIcon aria-hidden = "true" className = "hidden size-6 group-data-[open]:block" />
113+ </ DisclosureButton >
114+ </ div >
91115 </ div >
92116 </ div >
93117 < DisclosurePanel className = "md:hidden" >
@@ -107,8 +131,20 @@ export default function Navigationbar() {
107131 </ DisclosureButton >
108132 ) ) }
109133 </ div >
134+ < div className = "border-t border-gray-700 pb-3 pt-4" >
135+
136+ < div className = "flex justify-evenly" >
137+
138+ < FontSizeDropdown />
139+
140+ < div className = "px-5" >
141+ < ThemeSwitcher />
142+ </ div >
143+ </ div >
144+
145+ </ div >
110146 </ DisclosurePanel >
111147 </ Disclosure >
112- </ section >
148+ </ div >
113149 ) ;
114150} ;
0 commit comments