From 905517a690c4983851d538c1ab9a3a980324fd42 Mon Sep 17 00:00:00 2001 From: Sascha Date: Thu, 28 Aug 2025 13:59:43 +0200 Subject: [PATCH] added scrollintoview --- src/components/layout/Navigation.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/layout/Navigation.tsx b/src/components/layout/Navigation.tsx index 9afe37b..07cda38 100644 --- a/src/components/layout/Navigation.tsx +++ b/src/components/layout/Navigation.tsx @@ -19,6 +19,13 @@ export default function Navbar({ theme, setTheme }: Props) { 'Contact', ]; + function scrollToSection(section: string): void { + const element = document.getElementById(section); + if (element) { + element.scrollIntoView({ behavior: 'smooth' }); + } + } + return (
{personalConfig.name}
@@ -26,7 +33,7 @@ export default function Navbar({ theme, setTheme }: Props) { {menuItems.map((item) => (