style: Update NavigationItem isOpened initialization

This commit is contained in:
Gauthier Daniels 2025-04-22 12:38:00 +02:00
parent a212258c07
commit a2acd6be8f

View File

@ -27,7 +27,9 @@ function NavigationItem(props: NavigationItemProps) {
return props.section.links.some((link) => checkIsLinkActive(link));
};
const [isOpened, setIsOpened] = createSignal(checkIsActive());
const [isOpened, setIsOpened] = createSignal(
checkIsActive() || pageContext.urlPathname === "/",
);
createEffect(() => {
// If the current URL path is the same as the link's href, set isOpened to true