Simplify burger handling

This commit is contained in:
Timothy Armes
2023-10-11 08:36:45 +02:00
committed by Owen Rees
parent effb912641
commit 94cea267c9
7 changed files with 23 additions and 130 deletions
+8
View File
@@ -0,0 +1,8 @@
import { ScrollableElement } from "@/types";
const isBrowser = () => typeof window !== "undefined";
export const handleScrollToTop = (element: ScrollableElement | null) => {
if (!isBrowser()) return;
element?.scrollTo({ top: 0, behavior: "smooth" });
};