added index to the docs/types route, minor fixes to styling

This commit is contained in:
Xanazf 2024-10-17 19:35:39 +03:00
parent ea5b56acc8
commit 349c87a205
Signed by: Xanazf
GPG key ID: 4E4A5AD1FB748427
9 changed files with 109 additions and 32 deletions

View file

@ -1,4 +1,10 @@
import { createSignal, onMount, type Component } from "solid-js";
import {
createSignal,
createEffect,
onMount,
onCleanup,
type Component,
} from "solid-js";
import { LoadingSpinner, MenuToX, XToMenu } from "@icons";
import { Tree } from "./Tree";
@ -41,10 +47,21 @@ const NavComponent: Component<NavProps> = props => {
};
onMount(() => {
window.addEventListener("click", handleClickOutside);
return () => {
onCleanup(() => {
window.removeEventListener("click", handleClickOutside);
};
});
});
createEffect(() => {
if (open()) {
window.addEventListener("click", handleClickOutside);
document.body.style.overflow = "hidden";
document.body.classList.add("dim-content");
} else {
window.removeEventListener("click", handleClickOutside);
document.body.style.overflow = "auto";
document.body.classList.remove("dim-content");
}
});
return (