Add 404 page, three phone numbers, fix nginx try_files

This commit is contained in:
2026-03-14 01:37:23 +03:00
parent fc4c2c6d07
commit 8bfd0d7750
7 changed files with 61 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
import React, { useEffect } from 'react'
import React, { useEffect, useState } from 'react'
import { LanguageProvider, useLanguage } from './contexts/LanguageContext.jsx'
import Navigation from './components/Navigation.jsx'
import Footer from './components/Footer.jsx'
import Home from './pages/Home.jsx'
import NotFound from './pages/NotFound.jsx'
function LangSync() {
const { lang } = useLanguage()
@@ -12,13 +13,25 @@ function LangSync() {
return null
}
function Router() {
const [path, setPath] = useState(window.location.pathname)
useEffect(() => {
const handler = () => setPath(window.location.pathname)
window.addEventListener('popstate', handler)
return () => window.removeEventListener('popstate', handler)
}, [])
const isHome = path === '/' || path === '/index.html'
return isHome ? <Home /> : <NotFound />
}
export default function App() {
return (
<LanguageProvider>
<LangSync />
<Navigation />
<main>
<Home />
<Router />
</main>
<Footer />
</LanguageProvider>