From 201f59bd556788bb4d8e5d4604062ed7ab6f68e5 Mon Sep 17 00:00:00 2001 From: Maicol Battistini Date: Thu, 1 Jun 2023 17:28:13 +0200 Subject: [PATCH] chore: Usa solo `href` nel `DrawerEntry` --- resources/ts/Components/layout/DrawerEntry.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/ts/Components/layout/DrawerEntry.tsx b/resources/ts/Components/layout/DrawerEntry.tsx index 874131b53..499b1fc38 100644 --- a/resources/ts/Components/layout/DrawerEntry.tsx +++ b/resources/ts/Components/layout/DrawerEntry.tsx @@ -14,22 +14,21 @@ import {ValueOf} from 'type-fest'; type Icons = ValueOf; -export interface DrawerEntryAttributes extends Attributes { - route: string; +export interface DrawerEntryAttributes extends Attributes, ListItemLink { icon: Icons; } export class DrawerEntry extends Component { view(vnode: Vnode) { return ( - + ); } - isRouteActive(routeName: string) { - return route().current(routeName); + isRouteActive(href: string) { + return route(route().current()!) === href; } navigateToRoute(event: Event) {