mirror of
https://github.com/Xevion/utsa-handbook.git
synced 2025-12-06 01:16:46 -06:00
Remove useless function, fix type error isCurrentPage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user