mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:49:45 +00:00
Создал компонент PagePost - общий код для страницы лаборатории проекта, парсит запись из WordPress
This commit is contained in:
1 parent
3b6f9ae930
commit
7a470a08ad
2 files changed
+29
No files matched your search
@@ -0,0 +1,28 @@
|
|||||||
|
import { PageHeader, PageContent } from "../components";
|
||||||
|
import { MediaBlock, ProjectList } from "../../components";
|
||||||
|
|
||||||
|
function PagePost({ post, isLab = false }) {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader className="header">
|
||||||
|
<h1>{typeof post !== 'undefined' && post.name}</h1>
|
||||||
|
</PageHeader>
|
||||||
|
<PageContent className="content">
|
||||||
|
{typeof post !== 'undefined' && typeof post.content !== 'string' &&
|
||||||
|
post.content.map(el => {
|
||||||
|
console.log(el.type);
|
||||||
|
console.log(el);
|
||||||
|
if (el.type === 'mediablock') {
|
||||||
|
return <MediaBlock images={el.value} />;
|
||||||
|
}
|
||||||
|
return el;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
{post && isLab && <ProjectList laboratory={post.tag} />}
|
||||||
|
</PageContent>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PagePost;
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
export { default as PageHeader } from "./PageHeader";
|
export { default as PageHeader } from "./PageHeader";
|
||||||
export { default as PageContent } from "./PageContent";
|
export { default as PageContent } from "./PageContent";
|
||||||
|
export { default as PagePost } from "./PagePost";
|
||||||
Reference in new issue
Block a user