forked from Transparency/kgroad-frontend2
fixed sort in profile-reports table and in statistics table, improved error messages, improved metatags by fetching metadata from server
This commit is contained in:
1 parent
0221a79015
commit
0ba0f1df89
25 files changed
+413
-171
No files matched your search
@@ -4,26 +4,52 @@ import Image from "next/image";
|
||||
import header from "./assets/header.svg";
|
||||
import { Metadata } from "next";
|
||||
import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
|
||||
import { apiInstance } from "@/shared/config/apiConfig";
|
||||
import { IMetatag } from "@/shared/types/metatag-type";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "KG ROAD | О нас",
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
keywords: [
|
||||
"Миссия Transparency International - Кыргызстан",
|
||||
"Цели и приоритеты ТИ-Кыргызстан",
|
||||
],
|
||||
openGraph: {
|
||||
images: [
|
||||
{
|
||||
url: header.src,
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const data = await apiInstance
|
||||
.get<IMetatag[]>("/metatags/")
|
||||
.then((res) => res.data)
|
||||
.catch((e) => console.log(e));
|
||||
|
||||
if (!data)
|
||||
return {
|
||||
title: "KG ROAD | О нас",
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
openGraph: {
|
||||
title: "KG ROAD | О нас",
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
},
|
||||
],
|
||||
title: "KG ROAD | О нас",
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const metadata = data.filter((tag) => tag.page === "about-us")[0];
|
||||
if (!metadata) {
|
||||
return {
|
||||
title: "KG ROAD | О нас",
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
openGraph: {
|
||||
title: "KG ROAD | О нас",
|
||||
description:
|
||||
"Transparency International - Кыргызстан - филиал международной организации Transparency International в Кыргызской Республике.",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
title: `KG ROAD | ${metadata.title}`,
|
||||
description: metadata.description,
|
||||
keywords: metadata.keywords.split(","),
|
||||
openGraph: {
|
||||
title: `KG ROAD | ${metadata.title}`,
|
||||
description: metadata.description,
|
||||
type: "website",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const AboutUs = () => {
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user