mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
Simplify burger handling
This commit is contained in:
@@ -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" });
|
||||
};
|
||||
Reference in New Issue
Block a user