Skip to content

Commit 92f2694

Browse files
authored
feat: Use Link component for sidebar links (#441)
1 parent e7bb675 commit 92f2694

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

apps/app/app/(authenticated)/components/sidebar.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import {
5454
} from 'lucide-react';
5555
import type { ReactNode } from 'react';
5656
import { Search } from './search';
57+
import Link from 'next/link';
5758

5859
type GlobalSidebarProperties = {
5960
readonly children: ReactNode;
@@ -224,10 +225,10 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
224225
>
225226
<SidebarMenuItem>
226227
<SidebarMenuButton asChild tooltip={item.title}>
227-
<a href={item.url}>
228+
<Link href={item.url}>
228229
<item.icon />
229230
<span>{item.title}</span>
230-
</a>
231+
</Link>
231232
</SidebarMenuButton>
232233
{item.items?.length ? (
233234
<>
@@ -242,9 +243,9 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
242243
{item.items?.map((subItem) => (
243244
<SidebarMenuSubItem key={subItem.title}>
244245
<SidebarMenuSubButton asChild>
245-
<a href={subItem.url}>
246+
<Link href={subItem.url}>
246247
<span>{subItem.title}</span>
247-
</a>
248+
</Link>
248249
</SidebarMenuSubButton>
249250
</SidebarMenuSubItem>
250251
))}
@@ -263,10 +264,10 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
263264
{data.projects.map((item) => (
264265
<SidebarMenuItem key={item.name}>
265266
<SidebarMenuButton asChild>
266-
<a href={item.url}>
267+
<Link href={item.url}>
267268
<item.icon />
268269
<span>{item.name}</span>
269-
</a>
270+
</Link>
270271
</SidebarMenuButton>
271272
<DropdownMenu>
272273
<DropdownMenuTrigger asChild>
@@ -311,10 +312,10 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
311312
{data.navSecondary.map((item) => (
312313
<SidebarMenuItem key={item.title}>
313314
<SidebarMenuButton asChild>
314-
<a href={item.url}>
315+
<Link href={item.url}>
315316
<item.icon />
316317
<span>{item.title}</span>
317-
</a>
318+
</Link>
318319
</SidebarMenuButton>
319320
</SidebarMenuItem>
320321
))}

0 commit comments

Comments
 (0)