From 8a0f995f864bd0c1c7c89914e416a681c65007cb Mon Sep 17 00:00:00 2001 From: rxyhn Date: Fri, 13 Sep 2024 04:44:45 +0700 Subject: [PATCH] chore: optimize --- src/components/Boxes.tsx | 9 +++------ src/components/Drawer.astro | 15 --------------- src/components/Header.astro | 12 +++++------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/components/Boxes.tsx b/src/components/Boxes.tsx index f93bc18..d35ae28 100644 --- a/src/components/Boxes.tsx +++ b/src/components/Boxes.tsx @@ -13,21 +13,18 @@ export default function Boxes({ className = "" }: GridProps) { useEffect(() => { const updateDimensions = () => { if (containerRef.current) { - const { scrollHeight } = document.documentElement; setDimensions({ width: window.innerWidth, - height: Math.max(window.innerHeight, scrollHeight), + height: window.innerHeight, }); } }; window.addEventListener("resize", updateDimensions); - window.addEventListener("scroll", updateDimensions); updateDimensions(); return () => { window.removeEventListener("resize", updateDimensions); - window.removeEventListener("scroll", updateDimensions); }; }, []); @@ -45,8 +42,8 @@ export default function Boxes({ className = "" }: GridProps) { return (
{/* Left gradient overlay */}
diff --git a/src/components/Drawer.astro b/src/components/Drawer.astro index bdbd933..ec62521 100644 --- a/src/components/Drawer.astro +++ b/src/components/Drawer.astro @@ -1,5 +1,4 @@ --- -import { Icon } from "astro-icon/components"; import { LINKS } from "@/consts"; import { cn } from "@/lib/utils"; const { pathname } = Astro.url; @@ -30,20 +29,6 @@ const subpath = pathname.match(/[^/]+/g); )) } -
- -