diff --git a/package.json b/package.json index 4d5ba16..81b740b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "refansa.my.id", - "version": "0.0.1b", + "version": "0.0.1c", "private": true, "homepage": "https://refansa.my.id", "author": { diff --git a/src/components/blocks/header/header-navigation.tsx b/src/components/blocks/header/header-navigation.tsx index 3165d82..202138f 100644 --- a/src/components/blocks/header/header-navigation.tsx +++ b/src/components/blocks/header/header-navigation.tsx @@ -1,5 +1,8 @@ +'use client' + import Link from 'next/link' import dynamic from 'next/dynamic' +import { usePathname } from 'next/navigation' import { MenuIcon, XIcon } from 'lucide-react' @@ -30,10 +33,22 @@ const ThemeSwitch = dynamic( ) export default function HeaderNavigation() { + const pathname = usePathname() + + const smoothHeaderScroll = (e: any) => { + if (pathname === '/') { + e.preventDefault() + window.scrollTo({ + top: 0, + behavior: 'smooth', + }) + } + } + return (