11import clsx from "clsx" ;
22import Link from "next/link" ;
33import { useRouter } from "next/router" ;
4- import { MutableRefObject , useCallback , useEffect , useRef , useState } from "react" ;
5- import { GitHub , Home , Twitter } from "react-feather" ;
4+ import { MutableRefObject , ReactNode , useCallback , useEffect , useRef , useState } from "react" ;
5+ import { GitHub , Home } from "react-feather" ;
66import { Theme } from "./Theme" ;
77
88const PADDING = 8 ;
@@ -75,22 +75,17 @@ const Separator = ({ className }: { className?: string }) => {
7575const styles = {
7676 text : "dark:font-semibold text-white dark:text-black" ,
7777 homeText : "font-semibold dark:font-bold" ,
78- underline : "underline-themed " ,
78+ underline : "sm:hover: underline" ,
7979} ;
8080
8181export const Header = ( ) => {
8282 const [ theme , setTheme ] = useState ( "default" ) ;
8383 const { navRef, homeRef, projectsRef, aboutRef, left, width } = useNavigation ( theme ) ;
8484
8585 return (
86- < div
87- className = { clsx (
88- styles . text ,
89- "pointer-events-none fixed inset-x-0 bottom-0 flex sm:inset-x-8 sm:bottom-8"
90- ) }
91- >
86+ < div className = { clsx ( styles . text , "pointer-events-none fixed inset-x-8 bottom-8 flex" ) } >
9287 < nav
93- className = "pointer-events-auto relative flex w-full items-center bg-black/80 py-4 pl -4 pr-2 backdrop-blur dark:bg-white/80 sm:mx-auto sm:w-auto sm:rounded-md sm:px-6 sm:pr-4 "
88+ className = "pointer-events-auto relative flex w-auto mx-auto rounded-md items-center bg-black/80 px-6 py -4 backdrop-blur dark:bg-white/80"
9489 ref = { navRef as any }
9590 >
9691 < div
@@ -112,13 +107,13 @@ export const Header = () => {
112107 />
113108 </ Link >
114109 < Separator />
115- < ul className = "flex gap-3 sm:gap-6" >
110+ < ul className = "flex items-center gap-3 sm:gap-6" >
116111 { (
117112 [
118113 [ "/projects/" , "projects" , projectsRef ] ,
119114 // ['/blog/', 'blog'],
120115 [ "/about/" , "about" , aboutRef ] ,
121- ] as [ string , string , MutableRefObject < HTMLAnchorElement > ] [ ]
116+ ] as [ string , ReactNode , MutableRefObject < HTMLAnchorElement > ] [ ]
122117 ) . map ( ( [ url , title , ref ] ) => {
123118 return (
124119 < li key = { url } >
@@ -128,30 +123,18 @@ export const Header = () => {
128123 </ li >
129124 ) ;
130125 } ) }
126+ < li >
127+ < Link
128+ href = { "https://github.com/jsonnull" }
129+ className = { clsx ( styles . underline ) }
130+ target = "_blank"
131+ >
132+ < GitHub width = { 18 } height = { 18 } className = "" />
133+ </ Link >
134+ </ li >
131135 </ ul >
132136 < Separator className = "pr-1 sm:pr-4" />
133137 < Theme onChange = { ( theme ) => setTheme ( theme ) } />
134- < Separator className = "hidden px-1 sm:block sm:px-4" />
135- < ul className = "ml-auto flex items-center gap-1 leading-none text-zinc-400 dark:text-zinc-600 sm:gap-2" >
136- { (
137- [
138- [ GitHub , "https://github.com/jsonnull" ] ,
139- [ Twitter , "https://twitter.com/jsonnull" ] ,
140- ] as [ any , string ] [ ]
141- ) . map ( ( [ Icon , href ] ) => {
142- return (
143- < a
144- href = { href }
145- key = { href }
146- target = "_blank"
147- rel = "noopener noreferrer"
148- className = "rounded-full p-2 hover:bg-zinc-600 hover:text-white dark:hover:bg-zinc-400 dark:hover:text-black"
149- >
150- < Icon width = { 18 } height = { 18 } />
151- </ a >
152- ) ;
153- } ) }
154- </ ul >
155138 </ div >
156139 </ nav >
157140 </ div >
0 commit comments