src/hooks/smooth-scroll.tsx'use client'import { useEffect } from 'react'import { usePathname } from 'next/navigation'import { state } from '@/state'const SmoothScroll = () => {const offset = 40const pathname = usePathname()useEffect(() => {const smoothScroll = (hash: string) => {const targetElement = document.querySelector(hash)if (targetElement) {state.scrollingDirection = 'down'state.lockScrollDirection = true// Unlock after scroll completeswindow.addEventListener('scrollend',
Showing the first 20 lines.
Get full code