@@ -4,20 +4,23 @@ import logo from "../assets/logo_light_160.png";
44import { SideSheet } from "@douyinfe/semi-ui" ;
55import { IconMenu } from "@douyinfe/semi-icons" ;
66import { socials } from "../data/socials" ;
7+ import ThemeToggle from "./ThemeToggle" ;
8+ import { useTheme } from "../context/ThemeContext" ;
79
810export default function Navbar ( ) {
911 const [ openMenu , setOpenMenu ] = useState ( false ) ;
12+ const { theme } = useTheme ( ) ;
1013
1114 return (
1215 < >
13- < div className = "py-4 px-12 sm:px-4 flex justify-between items-center" >
14- < div className = "flex items-center justify-between w-full" >
16+ < div className = "py-4 px-12 sm:px-4 flex justify-between items-center dark:bg-gray-800 " >
17+ < div className = "flex items-center justify-between w-full relative " >
1518 < Link to = "/" >
1619 < img src = { logo } alt = "logo" className = "h-[48px] sm:h-[32px]" />
1720 </ Link >
1821 < div className = "md:hidden flex gap-12" >
1922 < Link
20- className = "text-lg font-semibold hover:text-sky-800 transition-colors duration-300"
23+ className = "text-lg font-semibold hover:text-sky-800 dark:text-gray-200 dark:hover:text-sky-400 transition-colors duration-300"
2124 onClick = { ( ) =>
2225 document
2326 . getElementById ( "features" )
@@ -28,32 +31,33 @@ export default function Navbar() {
2831 </ Link >
2932 < Link
3033 to = "/editor"
31- className = "text-lg font-semibold hover:text-sky-800 transition-colors duration-300"
34+ className = "text-lg font-semibold hover:text-sky-800 dark:text-gray-200 dark:hover:text-sky-400 transition-colors duration-300"
3235 >
3336 Editor
3437 </ Link >
3538 < Link
3639 to = "/templates"
37- className = "text-lg font-semibold hover:text-sky-800 transition-colors duration-300"
40+ className = "text-lg font-semibold hover:text-sky-800 dark:text-gray-200 dark:hover:text-sky-400 transition-colors duration-300"
3841 >
3942 Templates
4043 </ Link >
4144 < Link
4245 to = { socials . docs }
43- className = "text-lg font-semibold hover:text-sky-800 transition-colors duration-300"
46+ className = "text-lg font-semibold hover:text-sky-800 dark:text-gray-200 dark:hover:text-sky-400 transition-colors duration-300"
4447 >
4548 Docs
4649 </ Link >
4750 </ div >
48- < div className = "md:hidden block space-x-3 ms-12" >
51+ < div className = "md:hidden flex items-center space-x-3 ms-12" >
52+ < ThemeToggle className = "mr-2" />
4953 < a
5054 title = "Jump to Github"
5155 className = "px-2 py-2 hover:opacity-60 transition-all duration-300 rounded-full text-2xl"
5256 href = { socials . github }
5357 target = "_blank"
5458 rel = "noreferrer"
5559 >
56- < i className = "opacity-70 bi bi-github" />
60+ < i className = "opacity-70 bi bi-github dark:text-gray-200 " />
5761 </ a >
5862 < a
5963 title = "Follow us on X"
@@ -62,7 +66,7 @@ export default function Navbar() {
6266 target = "_blank"
6367 rel = "noreferrer"
6468 >
65- < i className = "opacity-70 bi bi-twitter-x" />
69+ < i className = "opacity-70 bi bi-twitter-x dark:text-gray-200 " />
6670 </ a >
6771 < a
6872 title = "Join the community on Discord"
@@ -71,13 +75,13 @@ export default function Navbar() {
7175 target = "_blank"
7276 rel = "noreferrer"
7377 >
74- < i className = "opacity-70 bi bi-discord" />
78+ < i className = "opacity-70 bi bi-discord dark:text-gray-200 " />
7579 </ a >
7680 </ div >
7781 </ div >
7882 < button
7983 onClick = { ( ) => setOpenMenu ( ( prev ) => ! prev ) }
80- className = "hidden md:inline-block h-[24px]"
84+ className = "hidden md:inline-block h-[24px] dark:text-gray-200 "
8185 >
8286 < IconMenu size = "extra-large" />
8387 </ button >
@@ -92,7 +96,7 @@ export default function Navbar() {
9296 width = { window . innerWidth }
9397 >
9498 < Link
95- className = "hover:bg-zinc-100 block p-3 text-base font-semibold"
99+ className = "hover:bg-zinc-100 dark:hover:bg-gray-700 block p-3 text-base font-semibold dark:text-gray-200 "
96100 onClick = { ( ) => {
97101 document
98102 . getElementById ( "features" )
@@ -105,24 +109,29 @@ export default function Navbar() {
105109 < hr />
106110 < Link
107111 to = "/editor"
108- className = "hover:bg-zinc-100 block p-3 text-base font-semibold"
112+ className = "hover:bg-zinc-100 dark:hover:bg-gray-700 block p-3 text-base font-semibold dark:text-gray-200 "
109113 >
110114 Editor
111115 </ Link >
112116 < hr />
113117 < Link
114118 to = "/templates"
115- className = "hover:bg-zinc-100 block p-3 text-base font-semibold"
119+ className = "hover:bg-zinc-100 dark:hover:bg-gray-700 block p-3 text-base font-semibold dark:text-gray-200 "
116120 >
117121 Templates
118122 </ Link >
119123 < hr />
120124 < Link
121125 to = { socials . docs }
122- className = "hover:bg-zinc-100 block p-3 text-base font-semibold"
126+ className = "hover:bg-zinc-100 dark:hover:bg-gray-700 block p-3 text-base font-semibold dark:text-gray-200 "
123127 >
124128 Docs
125129 </ Link >
130+ < hr className = "dark:border-gray-700" />
131+ < div className = "p-3 flex items-center" >
132+ < span className = "text-base font-semibold mr-3 dark:text-gray-200" > Theme:</ span >
133+ < ThemeToggle />
134+ </ div >
126135 </ SideSheet >
127136 </ >
128137 ) ;
0 commit comments