Skip to content

Commit 763296f

Browse files
committed
fix: remove deprecated env usage
1 parent 4f8afa8 commit 763296f

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

components/borrows/TabLink.tsx

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff 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
}

next.config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff 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
{

0 commit comments

Comments
 (0)