fix: replace TanStack Router Link with plain <a> in shared sidebar to avoid route type issues
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
|||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { Button } from '../../atoms';
|
import { Button } from '../../atoms';
|
||||||
import { FC, ReactElement, useState } from 'react';
|
import { FC, ReactElement, useState } from 'react';
|
||||||
import { Link, useLocation } from '@tanstack/react-router';
|
import { useLocation } from '@tanstack/react-router';
|
||||||
import { cn, For } from '@imphnen-frontend-service/utils';
|
import { cn, For } from '@imphnen-frontend-service/utils';
|
||||||
import { useSession } from '@imphnen-frontend-service/service';
|
import { useSession } from '@imphnen-frontend-service/service';
|
||||||
|
|
||||||
@@ -238,9 +238,9 @@ export const BackofficeSidebar: FC<SidebarProps> = ({
|
|||||||
{openGroups[menu.label] && (
|
{openGroups[menu.label] && (
|
||||||
<div className="mt-2 ml-6 flex flex-col gap-2">
|
<div className="mt-2 ml-6 flex flex-col gap-2">
|
||||||
{menu.children.map((child) => (
|
{menu.children.map((child) => (
|
||||||
<Link
|
<a
|
||||||
key={child.href}
|
key={child.href}
|
||||||
to={child.href}
|
href={child.href}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex items-center gap-3 px-2 py-2.5 rounded-md',
|
'flex items-center gap-3 px-2 py-2.5 rounded-md',
|
||||||
isActive(child.href)
|
isActive(child.href)
|
||||||
@@ -252,15 +252,15 @@ export const BackofficeSidebar: FC<SidebarProps> = ({
|
|||||||
<span className="text-label1 font-medium">
|
<span className="text-label1 font-medium">
|
||||||
{child.label}
|
{child.label}
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</a>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<Link
|
<a
|
||||||
key={menu.href ?? menu.label}
|
key={menu.href ?? menu.label}
|
||||||
to={menu.href ?? '#'}
|
href={menu.href ?? '#'}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex items-center justify-items-start gap-3 px-2 py-2.5',
|
'flex items-center justify-items-start gap-3 px-2 py-2.5',
|
||||||
menu.href && isActive(menu.href)
|
menu.href && isActive(menu.href)
|
||||||
@@ -270,7 +270,7 @@ export const BackofficeSidebar: FC<SidebarProps> = ({
|
|||||||
>
|
>
|
||||||
{menu.icon}
|
{menu.icon}
|
||||||
<span className="text-p3 font-medium">{menu.label}</span>
|
<span className="text-p3 font-medium">{menu.label}</span>
|
||||||
</Link>
|
</a>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</For>
|
</For>
|
||||||
|
|||||||
Reference in New Issue
Block a user