внесла правки в wppost

This commit is contained in:
xomimishka committed 2025-05-30 14:04:01 +03:00
1 parent 9ccc71e046
commit 7c7f98b448
1 file changed
+16 -4
+16 -4
View File
@@ -24,6 +24,8 @@ export default function WpPost({
const title = post.title; const title = post.title;
const customComponent = getCustomProject(title); const customComponent = getCustomProject(title);
const isSpecialTitle = title === "Программно-аппаратный комплекс для мониторинга управления мусорных контейнеров";
return ( return (
<div className={categories.includes("projects") ? "project" : ""}> <div className={categories.includes("projects") ? "project" : ""}>
{customComponent ? ( {customComponent ? (
@@ -31,14 +33,24 @@ export default function WpPost({
) : ( ) : (
<> <>
<PageHeader className="header"> <PageHeader className="header">
<h1>{post.title}</h1> <h1>{title}</h1>
</PageHeader> </PageHeader>
{Array.isArray(post.content) && {Array.isArray(post.content) &&
post.content.map((el, index) => { post.content.map((el, index) => {
if (el.type === "mediablock") { if (el.type === "mediablock") {
return <MediaBlock key={index} images={el.value} />; const media = <MediaBlock key={index} images={el.value} />;
return isSpecialTitle ? media : (
<PageContent key={index} className="content">
{media}
</PageContent>
);
} else if (el.type === "slider") { } else if (el.type === "slider") {
return <NewSlider key={index} images={el.value} slidesPerView={4} />; const slider = <NewSlider key={index} images={el.value} slidesPerView={4} />;
return isSpecialTitle ? slider : (
<PageContent key={index} className="content">
{slider}
</PageContent>
);
} }
return ( return (
<PageContent key={index} className="content"> <PageContent key={index} className="content">
@@ -51,4 +63,4 @@ export default function WpPost({
)} )}
</div> </div>
); );
} }