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

@@ -51,7 +51,7 @@
"url": "https://sag24.ru", "url": "https://sag24.ru",
"logo": "https://sag24.ru/favicon.svg", "logo": "https://sag24.ru/favicon.svg",
"image": "https://sag24.ru/og-image.svg", "image": "https://sag24.ru/og-image.svg",
"telephone": "+74953637476", "telephone": ["+74953637476", "+74953637335", "+74959454456"],
"email": "info@sag24.ru", "email": "info@sag24.ru",
"address": { "address": {
"@type": "PostalAddress", "@type": "PostalAddress",
@@ -97,7 +97,7 @@
}, },
"contactPoint": { "contactPoint": {
"@type": "ContactPoint", "@type": "ContactPoint",
"telephone": "+74953637476", "telephone": ["+74953637476", "+74953637335", "+74959454456"],
"contactType": "customer service", "contactType": "customer service",
"availableLanguage": ["Russian", "English"] "availableLanguage": ["Russian", "English"]
} }

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 { LanguageProvider, useLanguage } from './contexts/LanguageContext.jsx'
import Navigation from './components/Navigation.jsx' import Navigation from './components/Navigation.jsx'
import Footer from './components/Footer.jsx' import Footer from './components/Footer.jsx'
import Home from './pages/Home.jsx' import Home from './pages/Home.jsx'
import NotFound from './pages/NotFound.jsx'
function LangSync() { function LangSync() {
const { lang } = useLanguage() const { lang } = useLanguage()
@@ -12,13 +13,25 @@ function LangSync() {
return null 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() { export default function App() {
return ( return (
<LanguageProvider> <LanguageProvider>
<LangSync /> <LangSync />
<Navigation /> <Navigation />
<main> <main>
<Home /> <Router />
</main> </main>
<Footer /> <Footer />
</LanguageProvider> </LanguageProvider>

View File

@@ -4,14 +4,17 @@ import { useLanguage } from '../contexts/LanguageContext.jsx'
export default function Footer() { export default function Footer() {
const { t } = useLanguage() const { t } = useLanguage()
const year = new Date().getFullYear() const year = new Date().getFullYear()
const phones = t('contact.phones')
return ( return (
<footer className="bg-slate-900 text-slate-400 py-10"> <footer className="bg-slate-900 text-slate-400 py-10">
<div className="max-w-6xl mx-auto px-4 sm:px-6 flex flex-col md:flex-row items-center justify-between gap-4"> <div className="max-w-6xl mx-auto px-4 sm:px-6 flex flex-col md:flex-row items-center justify-between gap-4">
<span className="text-white font-semibold">Сисадмингрупп</span> <span className="text-white font-semibold">Сисадмингрупп</span>
<span className="text-sm">{year} © {t('footer.rights')}</span> <span className="text-sm">{year} © {t('footer.rights')}</span>
<div className="flex gap-6 text-sm"> <div className="flex flex-wrap justify-center gap-x-6 gap-y-1 text-sm">
<a href="tel:+74953637476" className="hover:text-white transition-colors">+7 495 363-74-76</a> {phones.map((p, i) => (
<a key={i} href={`tel:${p.replace(/\D/g,'')}`} className="hover:text-white transition-colors">{p}</a>
))}
<a href="mailto:info@sag24.ru" className="hover:text-white transition-colors">info@sag24.ru</a> <a href="mailto:info@sag24.ru" className="hover:text-white transition-colors">info@sag24.ru</a>
</div> </div>
</div> </div>

View File

@@ -117,13 +117,19 @@ export default function Home() {
<h2 className="text-3xl sm:text-4xl font-bold text-white mb-4">{t('contact.title')}</h2> <h2 className="text-3xl sm:text-4xl font-bold text-white mb-4">{t('contact.title')}</h2>
<p className="text-slate-400 text-lg mb-10">{t('contact.subtitle')}</p> <p className="text-slate-400 text-lg mb-10">{t('contact.subtitle')}</p>
<div className="flex flex-col gap-6"> <div className="flex flex-col gap-6">
<div className="flex items-center gap-4"> <div className="flex items-start gap-4">
<div className="w-10 h-10 bg-blue-500/10 rounded-lg flex items-center justify-center flex-shrink-0"> <div className="w-10 h-10 bg-blue-500/10 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5">
<Phone size={20} className="text-blue-400" /> <Phone size={20} className="text-blue-400" />
</div> </div>
<div> <div>
<div className="text-slate-400 text-xs uppercase tracking-wider mb-0.5">{t('contact.phone')}</div> <div className="text-slate-400 text-xs uppercase tracking-wider mb-1">{t('contact.phone')}</div>
<a href="tel:+74953637476" className="text-white font-medium hover:text-blue-400 transition-colors">+7 495 363-74-76</a> <div className="flex flex-col gap-1">
{t('contact.phones').map((phone, i) => (
<a key={i} href={`tel:${phone.replace(/\D/g,'')}`} className="text-white font-medium hover:text-blue-400 transition-colors">
{phone}
</a>
))}
</div>
</div> </div>
</div> </div>
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">

27
src/pages/NotFound.jsx Normal file
View File

@@ -0,0 +1,27 @@
import React from 'react'
import { useLanguage } from '../contexts/LanguageContext.jsx'
export default function NotFound() {
const { lang } = useLanguage()
return (
<div className="min-h-screen bg-slate-900 flex items-center justify-center px-4">
<div className="text-center">
<div className="text-8xl font-bold text-blue-600 mb-4">404</div>
<h1 className="text-2xl font-bold text-white mb-3">
{lang === 'ru' ? 'Страница не найдена' : 'Page not found'}
</h1>
<p className="text-slate-400 mb-8">
{lang === 'ru'
? 'Такой страницы не существует или она была удалена'
: 'This page does not exist or has been removed'}
</p>
<a
href="/"
className="px-6 py-3 bg-blue-600 hover:bg-blue-500 text-white font-semibold rounded-lg transition-colors"
>
{lang === 'ru' ? 'На главную' : 'Back to home'}
</a>
</div>
</div>
)
}

View File

@@ -42,6 +42,7 @@ export const en = {
contact: { contact: {
title: 'Contact Us', title: 'Contact Us',
subtitle: 'Tell us about your challenge — we will propose a solution', subtitle: 'Tell us about your challenge — we will propose a solution',
phones: ['+7 495 363-74-76', '+7 495 363-73-35', '+7 495 945-44-56'],
phone: 'Phone', phone: 'Phone',
email: 'Email', email: 'Email',
address: 'Address', address: 'Address',

View File

@@ -42,6 +42,7 @@ export const ru = {
contact: { contact: {
title: 'Свяжитесь с нами', title: 'Свяжитесь с нами',
subtitle: 'Расскажите о задаче — предложим решение', subtitle: 'Расскажите о задаче — предложим решение',
phones: ['+7 495 363-74-76', '+7 495 363-73-35', '+7 495 945-44-56'],
phone: 'Телефон', phone: 'Телефон',
email: 'Email', email: 'Email',
address: 'Адрес', address: 'Адрес',