File tree Expand file tree Collapse file tree 2 files changed +27
-21
lines changed
Expand file tree Collapse file tree 2 files changed +27
-21
lines changed Original file line number Diff line number Diff line change @@ -19,19 +19,33 @@ export const TabLink = <T extends string>({
1919 className
2020 ) }
2121 >
22- { tabs . map ( ( { name, href } ) => (
23- < Link
24- replace
25- key = { href }
26- href = { href }
27- className = { cn (
28- 'px-2 py-1 text-center text-sm font-medium text-foreground flex items-center justify-center min-w-[80px]' , // min-w ensures same width
29- activeHref === href && 'bg-background rounded-md shadow-sm'
30- ) }
31- >
32- { name }
33- </ Link >
34- ) ) }
22+ { tabs . map ( ( { name, href } ) => {
23+ const isActive = activeHref === href
24+ const shouldReplace = activeHref . includes ( '?' ) && href . includes ( '?' )
25+ const tabClassName = cn (
26+ 'px-2 py-1 text-center text-sm font-medium text-foreground flex items-center justify-center min-w-[80px]' ,
27+ isActive && 'bg-background rounded-md shadow-sm'
28+ )
29+
30+ if ( isActive ) {
31+ return (
32+ < a key = { href } href = "" aria-current = "page" className = { tabClassName } >
33+ { name }
34+ </ a >
35+ )
36+ }
37+
38+ return (
39+ < Link
40+ replace = { shouldReplace }
41+ key = { href }
42+ href = { href }
43+ className = { tabClassName }
44+ >
45+ { name }
46+ </ Link >
47+ )
48+ } ) }
3549 </ div >
3650 )
3751}
Original file line number Diff line number Diff line change @@ -19,14 +19,6 @@ const nextConfig: NextConfig = {
1919
2020 reactCompiler : true ,
2121
22- /* config options here */
23- env : {
24- API_URL : process . env . API_URL ,
25- SESSION_COOKIE_NAME : process . env . SESSION_COOKIE_NAME ,
26- APP_URL : process . env . APP_URL ,
27- LIBRARY_COOKIE_NAME : process . env . LIBRARY_COOKIE_NAME ,
28- } ,
29-
3022 rewrites : async ( ) => {
3123 return [
3224 {
You can’t perform that action at this time.
0 commit comments