Remove useless function, fix type error isCurrentPage

This commit is contained in:
2024-03-10 08:52:55 -05:00
parent a7a4a4765e
commit a9e1b7bbce

View File

@@ -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