@@ -7,7 +7,6 @@ import Image from "next/image";
7
7
import Link from "next/link" ;
8
8
import { useState } from "react" ;
9
9
import { CgClose } from "react-icons/cg" ;
10
- import { ThemedButton } from "../ThemedButton" ;
11
10
12
11
const Header = ( {
13
12
dict,
@@ -20,125 +19,105 @@ const Header = ({
20
19
} ;
21
20
} ) => {
22
21
const [ isMenuOpen , setIsMenuOpen ] = useState ( false ) ;
23
- return (
24
- < header className = "py-10 mx-auto max-w-7xl px-4 sm:px-6 lg:px-8" >
25
- < nav className = "relative z-50 flex justify-between" >
26
- < div className = "flex items-center md:gap-x-12" >
22
+
23
+
24
+ const LogoFC = ( ) => ( < div className = "flex items-center md:gap-x-12" >
25
+ < Link
26
+ href = "/"
27
+ aria-label = "FastGPT"
28
+ title = "FastGPT"
29
+ className = "flex items-center space-x-3 font-bold "
30
+ >
31
+ < Image
32
+ alt = { siteConfig . name }
33
+ src = "/logo.svg"
34
+ className = "w-[30px] h-[30px] bg-[#E9E9E9] p-1 rounded-md dark:bg-opacity-20"
35
+ width = { 32 }
36
+ height = { 32 }
37
+ />
38
+ < span className = "text-white hidden md:block" >
39
+ FastGPT
40
+ </ span >
41
+ </ Link >
42
+
43
+ < ul className = "hidden items-center gap-5 md:flex" >
44
+ { dict ?. links . map ( ( link ) => (
45
+ < li key = { link . label } className = "cursor-pointer hover:bg-white/10 px-2 py-1 rounded-md" >
27
46
< Link
28
- href = "/"
29
- aria-label = "FastGPT"
30
- title = "FastGPT"
31
- className = "flex items-center space-x-1 font-bold "
47
+ href = { link . href }
48
+ aria-label = { link . label }
49
+ title = { link . label }
50
+ className = "tracking-wide transition-colors duration-200 font-norma "
32
51
>
33
- < Image
34
- alt = { siteConfig . name }
35
- src = "/logo.svg"
36
- className = "w-8 h-8"
37
- width = { 32 }
38
- height = { 32 }
39
- />
40
- < span className = "text-gray-950 dark:text-gray-300 hidden md:block" >
41
- FastGPT
42
- </ span >
52
+ { link . label }
43
53
</ Link >
44
- </ div >
45
-
46
- < ul className = "hidden items-center gap-6 md:flex" >
47
- { dict ?. links . map ( ( link ) => (
48
- < li key = { link . label } >
49
- < Link
50
- href = { link . href }
51
- aria-label = { link . label }
52
- title = { link . label }
53
- className = "tracking-wide transition-colors duration-200 font-norma"
54
- >
55
- { link . label }
56
- </ Link >
57
- </ li >
58
- ) ) }
59
- </ ul >
54
+ </ li >
55
+ ) ) }
56
+ </ ul >
57
+ </ div > )
60
58
61
- < div className = "hidden md:flex items-center gap-x-6" >
59
+ return (
60
+ < header className = "relative py-2 mx-auto max-w-8xl px-4 sm:px-6 lg:px-8 flex justify-between" >
61
+ < nav className = "z-50 flex justify-between w-full" >
62
+ < LogoFC />
63
+ < div className = "hidden md:flex items-center gap-x-4" >
62
64
< HeaderLinks />
63
- < ThemedButton />
65
+ { /* <ThemedButton /> */ }
64
66
< LangSwitcher />
65
67
</ div >
68
+ </ nav >
66
69
67
- < div className = "md:hidden" >
68
- < button
69
- aria-label = "Open Menu"
70
- title = "Open Menu"
71
- className = "p-2 -mr-1 transition duration-200 rounded focus:outline-none focus:shadow-outline hover:bg-deep-purple-50 focus:bg-deep-purple-50"
72
- onClick = { ( ) => setIsMenuOpen ( true ) }
73
- >
74
- < MenuIcon />
75
- </ button >
76
- { isMenuOpen && (
77
- < div className = "absolute top-0 left-0 w-full z-50" >
78
- < div className = "p-5 bg-background border rounded shadow-sm" >
79
- < div className = "flex items-center justify-between mb-4" >
80
- < div >
81
- < Link
82
- href = "/"
83
- aria-label = "FastGPT"
84
- title = "FastGPT"
85
- className = "inline-flex items-center"
86
- >
87
- < Image
88
- alt = { siteConfig . name }
89
- src = "/logo.svg"
90
- className = "w-8 h-8"
91
- width = { 32 }
92
- height = { 32 }
93
- />
94
- < span className = "ml-2 text-xl font-bold tracking-wide text-gray-950 dark:text-gray-300" >
95
- FastGPT
96
- </ span >
97
- </ Link >
98
- </ div >
99
- < div >
100
- < button
101
- aria-label = "Close Menu"
102
- title = "Close Menu"
103
- className = "tracking-wide transition-colors duration-200 font-norma"
104
- onClick = { ( ) => setIsMenuOpen ( false ) }
105
- >
106
- < CgClose />
107
- </ button >
108
- </ div >
109
- </ div >
110
- < nav >
111
- < ul className = "space-y-4" >
112
- { dict ?. links . map ( ( link ) => (
113
- < li key = { link . label } >
114
- < Link
115
- href = { link . href }
116
- aria-label = { link . label }
117
- title = { link . label }
118
- className = "font-medium tracking-wide transition-colors duration-200 hover:text-deep-purple-accent-400"
119
- onClick = { ( ) => setIsMenuOpen ( false ) }
120
- >
121
- { link . label }
122
- </ Link >
123
- </ li >
124
- ) ) }
125
- </ ul >
126
- </ nav >
127
- < div className = "pt-2" >
128
- < div className = "py-2 font-bold" > Links</ div >
129
- < div className = "flex items-center gap-x-5 justify-between" >
130
- < HeaderLinks />
131
- < div className = "flex items-center justify-end gap-x-5" >
132
- < ThemedButton />
133
- < LangSwitcher />
134
- </ div >
135
- </ div >
70
+ < div className = "md:hidden" >
71
+ < button
72
+ aria-label = "Open Menu"
73
+ title = "Open Menu"
74
+ className = "p-2 -mr-1 transition duration-200 rounded focus:outline-none focus:shadow-outline hover:bg-deep-purple-50 focus:bg-deep-purple-50"
75
+ onClick = { ( ) => setIsMenuOpen ( true ) }
76
+ >
77
+ < MenuIcon />
78
+ </ button >
79
+ { isMenuOpen && (
80
+ < div className = "absolute top-0 left-0 z-50 w-screen h-screen bg-overlay/50" >
81
+ < div className = "p-5 bg-background rounded shadow-sm" >
82
+ < div className = "flex items-center justify-between mb-4" >
83
+ < LogoFC />
84
+ < div >
85
+ < button
86
+ aria-label = "Close Menu"
87
+ title = "Close Menu"
88
+ className = "tracking-wide transition-colors duration-200 font-norma"
89
+ onClick = { ( ) => setIsMenuOpen ( false ) }
90
+ >
91
+ < CgClose />
92
+ </ button >
136
93
</ div >
137
94
</ div >
95
+ < nav >
96
+ < ul className = "space-y-4" >
97
+ { dict ?. links . map ( ( link ) => (
98
+ < li key = { link . label } >
99
+ < Link
100
+ href = { link . href }
101
+ aria-label = { link . label }
102
+ title = { link . label }
103
+ className = "font-medium tracking-wide transition-colors duration-200 hover:text-deep-purple-accent-400 hover:bg-white/10 p-1 rounded-md"
104
+ onClick = { ( ) => setIsMenuOpen ( false ) }
105
+ >
106
+ { link . label }
107
+ </ Link >
108
+ </ li >
109
+ ) ) }
110
+ </ ul >
111
+ </ nav >
112
+ < div className = "mt-4 border-t-1 flex flex-col gap-6 pt-4 border-white/10" >
113
+ < HeaderLinks />
114
+ { /* <ThemedButton /> */ }
115
+ < LangSwitcher />
116
+ </ div >
138
117
</ div >
139
- ) }
140
- </ div >
141
- </ nav >
118
+ </ div >
119
+ ) }
120
+ </ div >
142
121
</ header >
143
122
) ;
144
123
} ;
0 commit comments