mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:49:45 +00:00
Развел карточки и пост в разные типы
This commit is contained in:
1 parent
de1e3beee3
commit
64b797bd38
3 files changed
+25
-22
No files matched your search
Vendored
+23
-18
@@ -181,15 +181,15 @@ declare namespace WPv2 {
|
|||||||
offset?: number;
|
offset?: number;
|
||||||
order?: "asc" | "desc";
|
order?: "asc" | "desc";
|
||||||
orderby?:
|
orderby?:
|
||||||
| "author"
|
| "author"
|
||||||
| "date"
|
| "date"
|
||||||
| "id"
|
| "id"
|
||||||
| "include"
|
| "include"
|
||||||
| "modified"
|
| "modified"
|
||||||
| "parent"
|
| "parent"
|
||||||
| "relevance"
|
| "relevance"
|
||||||
| "slug"
|
| "slug"
|
||||||
| "title";
|
| "title";
|
||||||
slug?: string[];
|
slug?: string[];
|
||||||
status?: string[];
|
status?: string[];
|
||||||
}
|
}
|
||||||
@@ -276,21 +276,26 @@ declare namespace App {
|
|||||||
export interface WpPost {
|
export interface WpPost {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
categories?: string[];
|
categories: string[];
|
||||||
tag:? number;
|
|
||||||
content?: ParsedContent[];
|
|
||||||
preview?: string | null;
|
|
||||||
previewText?: 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;
|
previewText: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PostsResult {
|
export interface PostsResult {
|
||||||
projects: Record<number, WpPost>;
|
projects: Record<number, Card>;
|
||||||
labs: Record<number, LabPost>;
|
labs: Record<number, LabCard>;
|
||||||
other: WpPost[];
|
other: WpPostPage[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MediaItem {
|
export interface MediaItem {
|
||||||
|
|||||||
@@ -22,9 +22,7 @@ export function CategoryPage({ category }: CategoryPageProps) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{categoryPosts.map((post) => (
|
{categoryPosts.map((post) => (
|
||||||
<WpPost key={post.id} post={post}>
|
<WpPost key={post.id} post={post} />
|
||||||
<div className="btn">Показать еще</div>
|
|
||||||
</WpPost>
|
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { PageContent, PageHeader } from "@/widgets/WpPost";
|
|||||||
import { App } from "@/shared/types/app";
|
import { App } from "@/shared/types/app";
|
||||||
|
|
||||||
interface WpPostProps {
|
interface WpPostProps {
|
||||||
post: App.WpPost;
|
post: App.WpPostPage;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user