mirror of
https://github.com/Xevion/utsa-handbook.git
synced 2025-12-06 07:16:47 -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 { currentPage } = Astro.props;
|
||||||
const currentPageMatch = currentPage.slice(1);
|
const currentPageMatch = currentPage.slice(1);
|
||||||
|
|
||||||
const isCurrentPage = (item): boolean => {
|
|
||||||
if (item.link) {
|
|
||||||
return item.link.includes(currentPageMatch);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getLinkClasses = (link: Link) => {
|
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 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, {
|
return clsx(baseClasses, {
|
||||||
// Classes for when the link is not the current page
|
// Classes for when the link is not the current page
|
||||||
|
|||||||
Reference in New Issue
Block a user