diff --git a/src/components/home/ScrollDownIcon.tsx b/src/components/home/ScrollDownIcon.tsx index 1239877..6fe93e4 100644 --- a/src/components/home/ScrollDownIcon.tsx +++ b/src/components/home/ScrollDownIcon.tsx @@ -20,14 +20,20 @@ const ScrollDownIcon = () => { }; }, []); // Tom dependency array betyr at effekten kjøres ved mount og cleanup ved unmount + const handleClick = (targetId: string) => { + const targetElement = document.getElementById(targetId); + targetElement?.scrollIntoView({ behavior: "smooth" }); + }; + return (
handleClick('home-text')} > - +
); }; diff --git a/src/pages/home.tsx b/src/pages/home.tsx index dfc46fc..a7c9a23 100644 --- a/src/pages/home.tsx +++ b/src/pages/home.tsx @@ -12,7 +12,7 @@ const HomePage = () => (

Online Fondet

-
{homeText}
+
{homeText}