Сохранение текущих изменений перед слиянием

This commit is contained in:
xomimishka committed 2025-04-24 15:27:30 +03:00
1 parent dd5d54a4e4
commit 4de84909cb
7 files changed
+26 -14

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
import Root from "@/app/Layout/Root";
import { routeConfig } from "@/shared/config/routeConfig/routeConfig";
import { createBrowserRouter } from "react-router-dom";
import { createHashRouter } from "react-router-dom";
export const appRouter = createBrowserRouter([
export const appRouter = createHashRouter([
{
element: <Root />,
+13 -1
View File
@@ -4,13 +4,25 @@ import { parseContent } from "@/shared/api/parseContent";
import { App, WPv2 } from "@/shared/types/app";
export const fetchPostById = async (id: number): Promise<App.WpPostPage> => {
const post = await wp.posts().id(id).get() as WPv2.Post;
const [post, categories] = await Promise.all([
wp.posts().id(id).get() as Promise<WPv2.Post>,
wp.categories().get() as Promise<WPv2.Category[]>,
]);
const categoryMap = new Map<number, string>(
categories.map((c) => [c.id, c.name])
);
const postCategories = post.categories.map(
(id) => categoryMap.get(id) || ""
);
const result: App.WpPostPage = {
id: post.id,
title: post.title.rendered,
content: parseContent(post.content.rendered),
tag: post.tags[0],
categories: postCategories,
};
return result;
+1 -1
View File
@@ -58,6 +58,6 @@ export const fetchPosts = async (): Promise<App.PostsResult> => {
result.other.push(newWpPostPage);
}
}
console.log('fetchPosts result', result);
return result;
};
+5 -5
View File
@@ -43,17 +43,17 @@ const MainPage = () => {
</HashLink>
</section>
</div>
<NewsList />
<ProjectsList />
<div className={styles.LabListContainer}>
<LabsList />
</div>
<div className={styles.NumbersContainer}>
<Numbers />
</div>
</div>
<NewsList />
<div className={styles.GalleryContainer}>
<Gallery />
</div>
<div className={styles.LabListContainer}>
<LabsList />
</div>
<div className={styles.mainContainer}>
<Partners />
</div>
+3 -3
View File
@@ -66,7 +66,7 @@ const LabsList = ({
items={transformPostsToCardData(labs)}
variant="lab"
gridConfig={gridConfig}
title="Лаборатории"
title="Наши лаборатории"
/>
</div>
);
@@ -82,7 +82,7 @@ const ProjectsList = ({
if (isLoading)
return (
<div className="mainContainer">
<h2 className={styles.title}>Проекты</h2>
<h2 className={styles.title}>Наши проекты</h2>
<span className="loader"></span>
</div>
);
@@ -96,7 +96,7 @@ const ProjectsList = ({
items={transformPostsToCardData(projects)}
variant="project"
gridConfig={gridConfig}
title="Проекты"
title="Наши проекты"
/>
</div>
);
+1 -1
View File
@@ -8,7 +8,7 @@ export const CardListTemplate = ({
items,
variant = "lab", // Значение по умолчанию
gridConfig = { desktop: 3, tablet: 2, mobile: 1 },
title = "Лаборатории",
title = "Наши лаборатории",
}: CardListProps) => {
const itemsArray = Object.values(items);