From a9e1b7bbce6ac46aaff29e5d5104224367945a43 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 10 Mar 2024 08:52:55 -0500 Subject: [PATCH] Remove useless function, fix type error isCurrentPage --- src/components/Sidebar.astro | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index 71e88aa..49046d0 100644 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -4,16 +4,9 @@ import clsx from 'clsx'; const { currentPage } = Astro.props; const currentPageMatch = currentPage.slice(1); -const isCurrentPage = (item): boolean => { - if (item.link) { - return item.link.includes(currentPageMatch); - } - return false; -}; - const getLinkClasses = (link: Link) => { const baseClasses = "block py-2 px-6 my-1 transition-colors border-l hover:border-zinc-400 hover:text-slate-900" - const isCurrent = isCurrentPage(link); + const isCurrent = link.link !== null ? link.link.includes(currentPageMatch) : false; return clsx(baseClasses, { // Classes for when the link is not the current page