1- " use client" ;
1+ ' use client' ;
22import { useEffect , useRef , useState } from 'react' ;
33import Link from 'next/link' ;
44import { usePathname } from 'next/navigation' ;
@@ -16,25 +16,33 @@ const productSections = [
1616const mainSections = [
1717 { label : 'Products' , href : '/product/sentry' } ,
1818 { label : 'SDKs' , href : '/platforms/' } ,
19- { label : 'Concepts & Reference' , href : '/concepts/' , dropdown : [
20- { label : 'Key Terms' , href : '/concepts/key-terms/' } ,
21- { label : 'Search' , href : '/concepts/search/' } ,
22- { label : 'Migration' , href : '/concepts/migration/' } ,
23- { label : 'Data Management' , href : '/concepts/data-management/' } ,
24- { label : 'Sentry CLI' , href : '/cli/' } ,
25- ] } ,
26- { label : 'Admin' , href : '/organization/' , dropdown : [
27- { label : 'Account Settings' , href : '/account/' } ,
28- { label : 'Organization Settings' , href : '/organization/' } ,
29- { label : 'Pricing & Billing' , href : '/pricing' } ,
30- ] } ,
19+ {
20+ label : 'Concepts & Reference' ,
21+ href : '/concepts/' ,
22+ dropdown : [
23+ { label : 'Key Terms' , href : '/concepts/key-terms/' } ,
24+ { label : 'Search' , href : '/concepts/search/' } ,
25+ { label : 'Migration' , href : '/concepts/migration/' } ,
26+ { label : 'Data Management' , href : '/concepts/data-management/' } ,
27+ { label : 'Sentry CLI' , href : '/cli/' } ,
28+ ] ,
29+ } ,
30+ {
31+ label : 'Admin' ,
32+ href : '/organization/' ,
33+ dropdown : [
34+ { label : 'Account Settings' , href : '/account/' } ,
35+ { label : 'Organization Settings' , href : '/organization/' } ,
36+ { label : 'Pricing & Billing' , href : '/pricing' } ,
37+ ] ,
38+ } ,
3139] ;
3240const moreSections = [
3341 { label : 'API' , href : '/api/' } ,
3442 { label : 'Security, Legal, & PII' , href : '/security-legal-pii/' } ,
3543] ;
3644
37- export default function TopNavClient ( { platforms} : { platforms : Platform [ ] } ) {
45+ export default function TopNavClient ( { platforms} : { platforms : Platform [ ] } ) {
3846 const [ platformDropdownOpen , setPlatformDropdownOpen ] = useState ( false ) ;
3947 const [ platformDropdownByClick , setPlatformDropdownByClick ] = useState ( false ) ;
4048 const platformBtnRef = useRef < HTMLButtonElement > ( null ) ;
@@ -93,7 +101,13 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
93101 }
94102 document . addEventListener ( 'mousedown' , handleClick ) ;
95103 return ( ) => document . removeEventListener ( 'mousedown' , handleClick ) ;
96- } , [ platformDropdownOpen , platformDropdownByClick , productsDropdownOpen , conceptsDropdownOpen , adminDropdownOpen ] ) ;
104+ } , [
105+ platformDropdownOpen ,
106+ platformDropdownByClick ,
107+ productsDropdownOpen ,
108+ conceptsDropdownOpen ,
109+ adminDropdownOpen ,
110+ ] ) ;
97111
98112 return (
99113 < ul className = "flex gap-4 w-full items-center" >
@@ -104,7 +118,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
104118 < button
105119 ref = { productsBtnRef }
106120 className = { `text-[var(--gray-12)] transition-colors duration-150 inline-block ${
107- ( productsDropdownOpen || isProductRoot )
121+ productsDropdownOpen || isProductRoot
108122 ? 'bg-[var(--accent-purple)] text-white rounded-md'
109123 : 'hover:text-[var(--accent)] py-2 px-1 rounded-t-md'
110124 } flex items-center gap-1`}
@@ -119,10 +133,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
119133 { section . label }
120134 < svg
121135 className = { `ml-1 transition-transform duration-150 ${ productsDropdownOpen ? 'rotate-180' : '' } ` }
122- width = "16" height = "16" viewBox = "0 0 16 16" fill = "none"
136+ width = "16"
137+ height = "16"
138+ viewBox = "0 0 16 16"
139+ fill = "none"
123140 xmlns = "http://www.w3.org/2000/svg"
124141 >
125- < path d = "M4 6L8 10L12 6" stroke = "currentColor" strokeWidth = "1.5" strokeLinecap = "round" strokeLinejoin = "round" />
142+ < path
143+ d = "M4 6L8 10L12 6"
144+ stroke = "currentColor"
145+ strokeWidth = "1.5"
146+ strokeLinecap = "round"
147+ strokeLinejoin = "round"
148+ />
126149 </ svg >
127150 </ button >
128151 { productsDropdownOpen && (
@@ -149,7 +172,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
149172 < button
150173 ref = { platformBtnRef }
151174 className = { `text-[var(--gray-12)] transition-colors duration-150 inline-block ${
152- ( platformDropdownOpen || isPlatformsRoute )
175+ platformDropdownOpen || isPlatformsRoute
153176 ? 'bg-[var(--accent-purple)] text-white rounded-md'
154177 : 'hover:text-[var(--accent)] py-2 px-1 rounded-t-md'
155178 } flex items-center gap-1`}
@@ -164,10 +187,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
164187 { section . label }
165188 < svg
166189 className = { `ml-1 transition-transform duration-150 ${ platformDropdownOpen ? 'rotate-180' : '' } ` }
167- width = "16" height = "16" viewBox = "0 0 16 16" fill = "none"
190+ width = "16"
191+ height = "16"
192+ viewBox = "0 0 16 16"
193+ fill = "none"
168194 xmlns = "http://www.w3.org/2000/svg"
169195 >
170- < path d = "M4 6L8 10L12 6" stroke = "currentColor" strokeWidth = "1.5" strokeLinecap = "round" strokeLinejoin = "round" />
196+ < path
197+ d = "M4 6L8 10L12 6"
198+ stroke = "currentColor"
199+ strokeWidth = "1.5"
200+ strokeLinecap = "round"
201+ strokeLinejoin = "round"
202+ />
171203 </ svg >
172204 </ button >
173205 { platformDropdownOpen && (
@@ -177,10 +209,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
177209 style = { { top : '100%' , marginTop : 0 } }
178210 onClick = { e => e . stopPropagation ( ) }
179211 >
180- < PlatformSelector
181- platforms = { platforms }
182- currentPlatform = { undefined }
183- />
212+ < PlatformSelector platforms = { platforms } currentPlatform = { undefined } />
184213 </ div >
185214 ) }
186215 </ div >
@@ -204,10 +233,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
204233 { section . label }
205234 < svg
206235 className = { `ml-1 transition-transform duration-150 ${ conceptsDropdownOpen ? 'rotate-180' : '' } ` }
207- width = "16" height = "16" viewBox = "0 0 16 16" fill = "none"
236+ width = "16"
237+ height = "16"
238+ viewBox = "0 0 16 16"
239+ fill = "none"
208240 xmlns = "http://www.w3.org/2000/svg"
209241 >
210- < path d = "M4 6L8 10L12 6" stroke = "currentColor" strokeWidth = "1.5" strokeLinecap = "round" strokeLinejoin = "round" />
242+ < path
243+ d = "M4 6L8 10L12 6"
244+ stroke = "currentColor"
245+ strokeWidth = "1.5"
246+ strokeLinecap = "round"
247+ strokeLinejoin = "round"
248+ />
211249 </ svg >
212250 </ button >
213251 { conceptsDropdownOpen && (
@@ -249,10 +287,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
249287 { section . label }
250288 < svg
251289 className = { `ml-1 transition-transform duration-150 ${ adminDropdownOpen ? 'rotate-180' : '' } ` }
252- width = "16" height = "16" viewBox = "0 0 16 16" fill = "none"
290+ width = "16"
291+ height = "16"
292+ viewBox = "0 0 16 16"
293+ fill = "none"
253294 xmlns = "http://www.w3.org/2000/svg"
254295 >
255- < path d = "M4 6L8 10L12 6" stroke = "currentColor" strokeWidth = "1.5" strokeLinecap = "round" strokeLinejoin = "round" />
296+ < path
297+ d = "M4 6L8 10L12 6"
298+ stroke = "currentColor"
299+ strokeWidth = "1.5"
300+ strokeLinecap = "round"
301+ strokeLinejoin = "round"
302+ />
256303 </ svg >
257304 </ button >
258305 { adminDropdownOpen && (
@@ -293,7 +340,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
293340 < div style = { { display : 'inline-block' } } >
294341 < button
295342 className = { `text-[var(--gray-12)] transition-colors duration-150 inline-block ${
296- ( moreDropdownOpen || moreSections . some ( s => pathname ?. startsWith ( s . href ) ) )
343+ moreDropdownOpen || moreSections . some ( s => pathname ?. startsWith ( s . href ) )
297344 ? 'bg-[var(--accent-purple)] text-white rounded-md'
298345 : 'hover:text-[var(--accent)] py-2 px-1 rounded-t-md'
299346 } flex items-center gap-1`}
@@ -304,10 +351,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
304351 More
305352 < svg
306353 className = { `ml-1 transition-transform duration-150 ${ moreDropdownOpen ? 'rotate-180' : '' } ` }
307- width = "16" height = "16" viewBox = "0 0 16 16" fill = "none"
354+ width = "16"
355+ height = "16"
356+ viewBox = "0 0 16 16"
357+ fill = "none"
308358 xmlns = "http://www.w3.org/2000/svg"
309359 >
310- < path d = "M4 6L8 10L12 6" stroke = "currentColor" strokeWidth = "1.5" strokeLinecap = "round" strokeLinejoin = "round" />
360+ < path
361+ d = "M4 6L8 10L12 6"
362+ stroke = "currentColor"
363+ strokeWidth = "1.5"
364+ strokeLinecap = "round"
365+ strokeLinejoin = "round"
366+ />
311367 </ svg >
312368 </ button >
313369 { moreDropdownOpen && (
@@ -346,4 +402,4 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
346402 ) ) }
347403 </ ul >
348404 ) ;
349- }
405+ }
0 commit comments