Обновлены метаданные в компоненте layout для SEO, изменены адреса в компонентах Contacts и Footer, улучшена структура отображения контактов. Добавлен динамический заголовок и описание для страницы услуги с использованием useEffect в компоненте ServicePage.

This commit is contained in:
Bivekich
2025-04-22 15:01:49 +03:00
parent 6ecc0affb8
commit ff16a39b2a
5 changed files with 91 additions and 74 deletions

View File

@ -1,6 +1,6 @@
'use client';
import { useState } from 'react';
import { useState, useEffect } from 'react';
import { motion } from 'framer-motion';
import {
ArrowLeft,
@ -33,6 +33,24 @@ export default function ServicePage({ params }: ServicePageProps) {
const { slug } = use(params);
const service = services.find((s) => s.slug === slug);
// Добавляем динамический заголовок и описание для SEO
useEffect(() => {
if (service) {
document.title = `${service.title} | СКЭ Проект`;
const metaDescription = document.querySelector(
'meta[name="description"]'
);
if (metaDescription) {
metaDescription.setAttribute('content', service.description);
} else {
const meta = document.createElement('meta');
meta.name = 'description';
meta.content = service.description;
document.head.appendChild(meta);
}
}
}, [service]);
if (!service) {
return <div>Услуга не найдена</div>;
}