From 64b797bd38a35a3c17d3ae05fc3a20f0ce40cf6f Mon Sep 17 00:00:00 2001 From: ifraimka1 Date: Tue, 15 Apr 2025 15:39:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D0=B2=D0=B5=D0=BB=20=D0=BA?= =?UTF-8?q?=D0=B0=D1=80=D1=82=D0=BE=D1=87=D0=BA=D0=B8=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D1=82=20=D0=B2=20=D1=80=D0=B0=D0=B7=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5=20=D1=82=D0=B8=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/types/app.d.ts | 41 +++++++++++++---------- src/widgets/CategoryPage/CategoryPage.tsx | 4 +-- src/widgets/WpPost/WpPost.tsx | 2 +- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/shared/types/app.d.ts b/src/shared/types/app.d.ts index e0d2fb4..9025138 100644 --- a/src/shared/types/app.d.ts +++ b/src/shared/types/app.d.ts @@ -181,15 +181,15 @@ declare namespace WPv2 { offset?: number; order?: "asc" | "desc"; orderby?: - | "author" - | "date" - | "id" - | "include" - | "modified" - | "parent" - | "relevance" - | "slug" - | "title"; + | "author" + | "date" + | "id" + | "include" + | "modified" + | "parent" + | "relevance" + | "slug" + | "title"; slug?: string[]; status?: string[]; } @@ -276,21 +276,26 @@ declare namespace App { export interface WpPost { id: number; title: string; - categories?: string[]; - tag:? number; - content?: ParsedContent[]; - preview?: string | null; - previewText?: string; + categories: string[]; } - export interface LabPost extends WpPost { + export interface WpPostPage extends WpPost { + content: ParsedContent[]; + tag: number; + } + + export interface Card extends WpPost { + preview: string | null; + } + + export interface LabCard extends Card { previewText: string; } export interface PostsResult { - projects: Record; - labs: Record; - other: WpPost[]; + projects: Record; + labs: Record; + other: WpPostPage[]; } export interface MediaItem { diff --git a/src/widgets/CategoryPage/CategoryPage.tsx b/src/widgets/CategoryPage/CategoryPage.tsx index 671076a..cfc65f8 100644 --- a/src/widgets/CategoryPage/CategoryPage.tsx +++ b/src/widgets/CategoryPage/CategoryPage.tsx @@ -22,9 +22,7 @@ export function CategoryPage({ category }: CategoryPageProps) { return ( <> {categoryPosts.map((post) => ( - -
Показать еще
-
+ ))} ); diff --git a/src/widgets/WpPost/WpPost.tsx b/src/widgets/WpPost/WpPost.tsx index 0f4df7a..9b5b038 100644 --- a/src/widgets/WpPost/WpPost.tsx +++ b/src/widgets/WpPost/WpPost.tsx @@ -6,7 +6,7 @@ import { PageContent, PageHeader } from "@/widgets/WpPost"; import { App } from "@/shared/types/app"; interface WpPostProps { - post: App.WpPost; + post: App.WpPostPage; children?: ReactNode; }