mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:59:45 +00:00
Сохранение текущих изменений перед слиянием
This commit is contained in:
1 parent
dd5d54a4e4
commit
4de84909cb
7 files changed
+26
-14
No files matched your search
@@ -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 />,
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -58,6 +58,6 @@ export const fetchPosts = async (): Promise<App.PostsResult> => {
|
||||
result.other.push(newWpPostPage);
|
||||
}
|
||||
}
|
||||
console.log('fetchPosts result', result);
|
||||
|
||||
return result;
|
||||
};
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import react from "@vitejs/plugin-react";
|
||||
import path from "path";
|
||||
|
||||
export default defineConfig({
|
||||
base: '/wp-content/reactpress/apps/skb/dist/',
|
||||
base: "/wp-content/reactpress/apps/skb/dist/index.html",
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Reference in new issue
Block a user