forked from Transparency/kgroad-frontend2
improved seo, made not-found page, fixed bugs in news details and in report datails pages
This commit is contained in:
1 parent
7d36510a9b
commit
ad86f2e79e
18 files changed
+224
-30
No files matched your search
@@ -7,7 +7,22 @@ import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "KG ROAD | О нас",
|
||||
description: 'Страница "О Нас" KG ROAD',
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
keywords: [
|
||||
"Миссия Transparency International - Кыргызстан",
|
||||
"Цели и приоритеты ТИ-Кыргызстан",
|
||||
],
|
||||
openGraph: {
|
||||
images: [
|
||||
{
|
||||
url: header.src,
|
||||
},
|
||||
],
|
||||
title: "KG ROAD | О нас",
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
},
|
||||
};
|
||||
|
||||
const AboutUs = () => {
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
@import url("https://fonts.cdnfonts.com/css/inter");
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: "Tilda Sans";
|
||||
}
|
||||
|
||||
button,
|
||||
a,
|
||||
input {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
button {
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
input {
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.page-padding {
|
||||
padding: 40px 90px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.page-padding {
|
||||
padding: 40px 30px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 550px) {
|
||||
.page-padding {
|
||||
padding: 40px 16px;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.scss";
|
||||
import "../globals.scss";
|
||||
import "./App.scss";
|
||||
import "@/shared/fonts/fonts.scss";
|
||||
import Navbar from "@/widgets/Navbar/Navbar";
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import NotFound from "@/widgets/NotFound/NotFound";
|
||||
|
||||
const error = () => {
|
||||
return <NotFound />;
|
||||
};
|
||||
|
||||
export default error;
|
||||
@@ -7,11 +7,33 @@ import message from "./icons/message.svg";
|
||||
import calendar from "./icons/calendar.svg";
|
||||
import ReviewSection from "@/widgets/ReviewSection/ReviewSection";
|
||||
import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
|
||||
import { Metadata } from "next";
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: { id: string };
|
||||
}): Promise<Metadata> {
|
||||
const response = await apiInstance.get<INews>(
|
||||
`/news/${params.id}/`
|
||||
);
|
||||
|
||||
return {
|
||||
title: response.data.title,
|
||||
description: response.data.description,
|
||||
openGraph: {
|
||||
images: [response.data.image],
|
||||
type: "article",
|
||||
publishedTime: response.data.created_at,
|
||||
},
|
||||
keywords: ["Новости КР", "Дорожные происшествия", "Кыргызстан"],
|
||||
};
|
||||
}
|
||||
|
||||
const NewsDetails = async ({
|
||||
params,
|
||||
}: {
|
||||
params: { id: string };
|
||||
params: { id: string; новость: string };
|
||||
}) => {
|
||||
const getNewsById = async () => {
|
||||
const response = await apiInstance.get<INews>(
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import NotFound from "@/widgets/NotFound/NotFound";
|
||||
import "../globals.scss";
|
||||
import "@/shared/fonts/fonts.scss";
|
||||
|
||||
export default function NotFoundPage() {
|
||||
return <NotFound />;
|
||||
}
|
||||
@@ -8,7 +8,24 @@ import { Metadata } from "next";
|
||||
export const metadata: Metadata = {
|
||||
title: "KG ROAD | Главная",
|
||||
description:
|
||||
"Главная страница KG ROAD",
|
||||
"Главная страница KG ROAD | Сделаем дороги безопасными!",
|
||||
keywords: [
|
||||
"Новости",
|
||||
"Разбитые дороги",
|
||||
"Очаги аварийности",
|
||||
"Локальные дефекты",
|
||||
"Дороги В планах ремонта",
|
||||
"Отремонтированные дороги",
|
||||
"Исправленные локальные дефекты",
|
||||
"Карта дорог",
|
||||
"Рейтинг",
|
||||
],
|
||||
openGraph: {
|
||||
title: "KG ROAD | Главная",
|
||||
description:
|
||||
"Главная страница KG ROAD | Сделаем дороги безопасными!",
|
||||
type: "website",
|
||||
},
|
||||
};
|
||||
|
||||
const Home = async ({
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import NotFound from "@/widgets/NotFound/NotFound";
|
||||
|
||||
const error = () => {
|
||||
return <NotFound />;
|
||||
};
|
||||
|
||||
export default error;
|
||||
@@ -6,6 +6,8 @@ import ReportInformation from "@/widgets/report-details/ReportInformation/Report
|
||||
import ReportImages from "@/widgets/report-details/ReportImages/ReportImages";
|
||||
import dynamic from "next/dynamic";
|
||||
import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
|
||||
import NotFound from "@/widgets/NotFound/NotFound";
|
||||
import { apiInstance } from "@/shared/config/apiConfig";
|
||||
|
||||
const DynamicMap = dynamic(
|
||||
() => import("@/widgets/report-details/ReportMap/ReportMap"),
|
||||
@@ -14,27 +16,45 @@ const DynamicMap = dynamic(
|
||||
}
|
||||
);
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "KG ROAD | Обращение",
|
||||
description:
|
||||
"Страница обращения Kyrgyzstan Transperency International",
|
||||
};
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: { id: string };
|
||||
}): Promise<Metadata> {
|
||||
const response = await apiInstance.get<IReport>(
|
||||
`/report/${params.id}/`
|
||||
);
|
||||
|
||||
return {
|
||||
title: `KG ROAD | ${response.data.location[0].address}`,
|
||||
description: response.data.description,
|
||||
openGraph: {
|
||||
title: `KG ROAD | ${response.data.location[0].address}`,
|
||||
description: response.data.description,
|
||||
images: [response.data.image[0].image],
|
||||
type: "website",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const ReportDetails = async ({
|
||||
params,
|
||||
}: {
|
||||
params: { id: string };
|
||||
}) => {
|
||||
console.log(JSON.parse(params.id));
|
||||
const getReportDetails = async () => {
|
||||
const res = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_BASE_API}/report/${params.id}/`,
|
||||
{ cache: "no-store" }
|
||||
);
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_BASE_API}/report/${params.id}/`,
|
||||
{ cache: "no-store" }
|
||||
);
|
||||
|
||||
return res.json();
|
||||
return res.json();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
const report: IReport = (await getReportDetails()) || {};
|
||||
const report: IReport = await getReportDetails();
|
||||
|
||||
return (
|
||||
<div className="report-details page-padding">
|
||||
|
||||
@@ -4,11 +4,17 @@ import StatisticsTable from "@/widgets/tables/StatisticsTable/StatisticsTable";
|
||||
import { Metadata } from "next";
|
||||
import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "KG ROAD | Статистика",
|
||||
description: "Страница статистики KG ROAD",
|
||||
};
|
||||
|
||||
export async function generateMetadata({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: { "поиск-населенного-пункта": string };
|
||||
}): Promise<Metadata> {
|
||||
return {
|
||||
title: "KG ROAD | Статистика",
|
||||
description: `Статистика по ${searchParams["поиск-населенного-пункта"]} KG ROAD`,
|
||||
keywords: ["Бишкек", "Чуй", "Кыргызстан", "Дороги"],
|
||||
};
|
||||
}
|
||||
const Statistics = ({
|
||||
searchParams,
|
||||
}: {
|
||||
|
||||
@@ -6,7 +6,7 @@ import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "KG ROAD | Волонтеры",
|
||||
description: "Страница волонтеров KG ROAD",
|
||||
description: "Страница лучших волонтеров Кыргызской Республики!",
|
||||
};
|
||||
|
||||
const Volunteers = () => {
|
||||
|
||||
Reference in new issue
Block a user