Skip to content

Commit

Permalink
feat: Use Link component for sidebar links (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamenchens authored Feb 9, 2025
1 parent e7bb675 commit 92f2694
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions apps/app/app/(authenticated)/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
} from 'lucide-react';
import type { ReactNode } from 'react';
import { Search } from './search';
import Link from 'next/link';

type GlobalSidebarProperties = {
readonly children: ReactNode;
Expand Down Expand Up @@ -224,10 +225,10 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
>
<SidebarMenuItem>
<SidebarMenuButton asChild tooltip={item.title}>
<a href={item.url}>
<Link href={item.url}>
<item.icon />
<span>{item.title}</span>
</a>
</Link>
</SidebarMenuButton>
{item.items?.length ? (
<>
Expand All @@ -242,9 +243,9 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
{item.items?.map((subItem) => (
<SidebarMenuSubItem key={subItem.title}>
<SidebarMenuSubButton asChild>
<a href={subItem.url}>
<Link href={subItem.url}>
<span>{subItem.title}</span>
</a>
</Link>
</SidebarMenuSubButton>
</SidebarMenuSubItem>
))}
Expand All @@ -263,10 +264,10 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
{data.projects.map((item) => (
<SidebarMenuItem key={item.name}>
<SidebarMenuButton asChild>
<a href={item.url}>
<Link href={item.url}>
<item.icon />
<span>{item.name}</span>
</a>
</Link>
</SidebarMenuButton>
<DropdownMenu>
<DropdownMenuTrigger asChild>
Expand Down Expand Up @@ -311,10 +312,10 @@ export const GlobalSidebar = ({ children }: GlobalSidebarProperties) => {
{data.navSecondary.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton asChild>
<a href={item.url}>
<Link href={item.url}>
<item.icon />
<span>{item.title}</span>
</a>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
))}
Expand Down

0 comments on commit 92f2694

Please sign in to comment.