Skip to content

Commit

Permalink
scroll to anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
groninge01 committed Dec 24, 2024
1 parent 58e1b98 commit 9484691
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/beets-frontend-v3/app/(marketing)/risks/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,23 @@ import Link from 'next/link'
import { Container, Divider, Box } from '@chakra-ui/react'
import { Prose } from '@nikolovlazar/chakra-ui-prose'
import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
import { useEffect } from 'react'

export default function Privacy() {
useEffect(() => {
const handleHashChange = () => {
const { hash } = window.location
if (hash) {
const id = hash.substring(1)
const element = document.getElementById(id)
element?.scrollIntoView({ behavior: 'smooth' })
}
}

// Run on initial load
handleHashChange()
}, [])

return (
<Container p="0">
<Prose>
Expand Down

0 comments on commit 9484691

Please sign in to comment.