mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 04:39:45 +00:00
Перенес структуру Севы
This commit is contained in:
1 parent
808d97eb4b
commit
060110008c
54 files changed
+816
-2263
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { usePosts } from "@/modules/posts/hooks/usePosts";
|
||||
import { PagePost } from "@/widgets/PostPage";
|
||||
import { WpPost } from "@/widgets/WpPost";
|
||||
|
||||
interface CategoryPageProps {
|
||||
category: string;
|
||||
@@ -22,9 +22,9 @@ export function CategoryPage({ category }: CategoryPageProps) {
|
||||
return (
|
||||
<>
|
||||
{categoryPosts.map((post) => (
|
||||
<PagePost key={post.id} post={post}>
|
||||
<WpPost key={post.id} post={post}>
|
||||
<div className="btn">Показать еще</div>
|
||||
</PagePost>
|
||||
</WpPost>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
import MediaBlock from "@/widgets/MediaBlock/MediaBlock";
|
||||
|
||||
import { PageContent, PageHeader } from "@/widgets/PostPage";
|
||||
import { App } from "@/shared/types/app";
|
||||
|
||||
interface PagePostProps {
|
||||
post: App.ProjectPost;
|
||||
isLab?: boolean;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export default function PagePost({
|
||||
post,
|
||||
|
||||
children,
|
||||
}: PagePostProps) {
|
||||
return (
|
||||
<>
|
||||
<PageHeader className="header">
|
||||
<h1>{post.title}</h1>
|
||||
</PageHeader>
|
||||
<PageContent className="content">
|
||||
{Array.isArray(post.content) &&
|
||||
post.content.map((el, index) => {
|
||||
if (el.type === "mediablock") {
|
||||
return <MediaBlock key={index} images={el.value} />;
|
||||
}
|
||||
return <div key={index}>{el.element}</div>;
|
||||
})}
|
||||
{children}
|
||||
</PageContent>
|
||||
</>
|
||||
);
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
export { default as PageHeader } from "./PageHeader";
|
||||
export { default as PageContent } from "./PageContent";
|
||||
export { default as PagePost } from "./PagePost";
|
||||
export { default as WpPost } from "./WpPost";
|
||||
Reference in new issue
Block a user