1
1
import clsx from "clsx" ;
2
2
import Link from "next/link" ;
3
3
import { 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" ;
6
6
import { Theme } from "./Theme" ;
7
7
8
8
const PADDING = 8 ;
@@ -75,7 +75,7 @@ const Separator = ({ className }: { className?: string }) => {
75
75
const styles = {
76
76
text : "dark:font-semibold text-white dark:text-black" ,
77
77
homeText : "font-semibold dark:font-bold" ,
78
- underline : "underline-themed " ,
78
+ underline : "sm:hover: underline" ,
79
79
} ;
80
80
81
81
export const Header = ( ) => {
@@ -86,11 +86,11 @@ export const Header = () => {
86
86
< div
87
87
className = { clsx (
88
88
styles . text ,
89
- "pointer-events-none fixed inset-x-0 bottom-0 flex sm:inset-x-8 sm:bottom-8"
89
+ "pointer-events-none fixed inset-x-4 bottom-4 flex sm:inset-x-8 sm:bottom-8"
90
90
) }
91
91
>
92
92
< 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 "
93
+ className = "pointer-events-auto relative mx-auto flex w-auto items-center rounded-md bg-black/80 px-6 py -4 backdrop-blur dark:bg-white/80"
94
94
ref = { navRef as any }
95
95
>
96
96
< div
@@ -112,13 +112,13 @@ export const Header = () => {
112
112
/>
113
113
</ Link >
114
114
< Separator />
115
- < ul className = "flex gap-3 sm:gap-6" >
115
+ < ul className = "flex items-center gap-3 sm:gap-6" >
116
116
{ (
117
117
[
118
118
[ "/projects/" , "projects" , projectsRef ] ,
119
119
// ['/blog/', 'blog'],
120
120
[ "/about/" , "about" , aboutRef ] ,
121
- ] as [ string , string , MutableRefObject < HTMLAnchorElement > ] [ ]
121
+ ] as [ string , ReactNode , MutableRefObject < HTMLAnchorElement > ] [ ]
122
122
) . map ( ( [ url , title , ref ] ) => {
123
123
return (
124
124
< li key = { url } >
@@ -128,30 +128,18 @@ export const Header = () => {
128
128
</ li >
129
129
) ;
130
130
} ) }
131
+ < li >
132
+ < Link
133
+ href = { "https://github.com/jsonnull" }
134
+ className = { clsx ( styles . underline ) }
135
+ target = "_blank"
136
+ >
137
+ < GitHub width = { 18 } height = { 18 } className = "" />
138
+ </ Link >
139
+ </ li >
131
140
</ ul >
132
141
< Separator className = "pr-1 sm:pr-4" />
133
142
< 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 >
155
143
</ div >
156
144
</ nav >
157
145
</ div >
0 commit comments