Add 404 page, three phone numbers, fix nginx try_files
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
"url": "https://sag24.ru",
|
||||
"logo": "https://sag24.ru/favicon.svg",
|
||||
"image": "https://sag24.ru/og-image.svg",
|
||||
"telephone": "+74953637476",
|
||||
"telephone": ["+74953637476", "+74953637335", "+74959454456"],
|
||||
"email": "info@sag24.ru",
|
||||
"address": {
|
||||
"@type": "PostalAddress",
|
||||
@@ -97,7 +97,7 @@
|
||||
},
|
||||
"contactPoint": {
|
||||
"@type": "ContactPoint",
|
||||
"telephone": "+74953637476",
|
||||
"telephone": ["+74953637476", "+74953637335", "+74959454456"],
|
||||
"contactType": "customer service",
|
||||
"availableLanguage": ["Russian", "English"]
|
||||
}
|
||||
|
||||
17
src/App.jsx
17
src/App.jsx
@@ -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>
|
||||
|
||||
@@ -4,14 +4,17 @@ import { useLanguage } from '../contexts/LanguageContext.jsx'
|
||||
export default function Footer() {
|
||||
const { t } = useLanguage()
|
||||
const year = new Date().getFullYear()
|
||||
const phones = t('contact.phones')
|
||||
|
||||
return (
|
||||
<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">
|
||||
<span className="text-white font-semibold">Сисадмингрупп</span>
|
||||
<span className="text-sm">{year} © {t('footer.rights')}</span>
|
||||
<div className="flex gap-6 text-sm">
|
||||
<a href="tel:+74953637476" className="hover:text-white transition-colors">+7 495 363-74-76</a>
|
||||
<div className="flex flex-wrap justify-center gap-x-6 gap-y-1 text-sm">
|
||||
{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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
<p className="text-slate-400 text-lg mb-10">{t('contact.subtitle')}</p>
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="w-10 h-10 bg-blue-500/10 rounded-lg flex items-center justify-center flex-shrink-0">
|
||||
<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 mt-0.5">
|
||||
<Phone size={20} className="text-blue-400" />
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-slate-400 text-xs uppercase tracking-wider mb-0.5">{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="text-slate-400 text-xs uppercase tracking-wider mb-1">{t('contact.phone')}</div>
|
||||
<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 className="flex items-center gap-4">
|
||||
|
||||
27
src/pages/NotFound.jsx
Normal file
27
src/pages/NotFound.jsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -42,6 +42,7 @@ export const en = {
|
||||
contact: {
|
||||
title: 'Contact Us',
|
||||
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',
|
||||
email: 'Email',
|
||||
address: 'Address',
|
||||
|
||||
@@ -42,6 +42,7 @@ export const ru = {
|
||||
contact: {
|
||||
title: 'Свяжитесь с нами',
|
||||
subtitle: 'Расскажите о задаче — предложим решение',
|
||||
phones: ['+7 495 363-74-76', '+7 495 363-73-35', '+7 495 945-44-56'],
|
||||
phone: 'Телефон',
|
||||
email: 'Email',
|
||||
address: 'Адрес',
|
||||
|
||||
Reference in New Issue
Block a user