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(() => {if (!sessionStorage.getItem('entryHistoryLength')) {sessionStorage.setItem('entryHistoryLength', String(window.history.length))}const getScrollContainer = (el: Element): Element | Window => {let parent = el.parentElementwhile (parent) {const style = getComputedStyle(parent)if (
Showing the first 20 lines.
Get full code