refactor: change routing to astro

This commit is contained in:
Zotov Ivan Yuryevich
2026-04-04 13:56:22 +03:00
parent 05d6e7f6d5
commit ad3655c285
40 changed files with 4923 additions and 820 deletions

41
src/views/HomePage.tsx Normal file
View File

@@ -0,0 +1,41 @@
import { useEffect, useState } from 'react'
import { Hero } from '../components/Hero'
import { Services } from '../components/Services'
import { Solutions } from '../components/Solutions'
import { Cases } from '../components/Cases'
import { About } from '../components/About'
import { Contact } from '../components/Contact'
import { ContactModal } from '../components/ContactModal'
import { scrollToHashTarget } from '../lib/scrollToHash'
const HEADER_OFFSET_PX = 85
export function HomePage() {
const [contactOpen, setContactOpen] = useState(false)
useEffect(() => {
const onHashChange = () => scrollToHashTarget(window.location.hash.slice(1))
onHashChange()
window.addEventListener('hashchange', onHashChange)
return () => window.removeEventListener('hashchange', onHashChange)
}, [])
return (
<>
<Hero onOpenContactModal={() => setContactOpen(true)} />
<Services />
<Solutions />
<div id="cases" style={{ scrollMarginTop: HEADER_OFFSET_PX }}>
<Cases />
</div>
<div id="about" style={{ scrollMarginTop: HEADER_OFFSET_PX }}>
<About />
</div>
<div id="contact" style={{ scrollMarginTop: HEADER_OFFSET_PX }}>
<Contact />
</div>
<ContactModal isOpen={contactOpen} onClose={() => setContactOpen(false)} />
</>
)
}