From 102121498b45ef221191401f6216260f072f78a9 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 15 Dec 2021 18:18:49 +0100 Subject: chore: create single post view --- src/ts/types/articles.ts | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'src/ts/types/articles.ts') diff --git a/src/ts/types/articles.ts b/src/ts/types/articles.ts index 5d5fbc5..664e237 100644 --- a/src/ts/types/articles.ts +++ b/src/ts/types/articles.ts @@ -1,4 +1,6 @@ +import { Comment, CommentsResponse } from './comments'; import { Cover, CoverResponse } from './cover'; +import { SEO } from './seo'; import { SubjectPreview, ThematicPreview } from './taxonomies'; export type ArticleDates = { @@ -11,7 +13,7 @@ export type ArticlePreviewResponse = { postsInSubject: SubjectPreview[] | null; postsInThematics: ThematicPreview[] | null; }; - commentCount: number; + commentCount: number | null; contentParts: { beforeMore: string; }; @@ -25,7 +27,7 @@ export type ArticlePreviewResponse = { }; export type ArticlePreview = { - commentCount: number; + commentCount: number | null; content: string; databaseId: number; date: ArticleDates; @@ -36,3 +38,33 @@ export type ArticlePreview = { thematics: ThematicPreview[] | []; title: string; }; + +export type ArticleResponse = ArticlePreviewResponse & { + comments: CommentsResponse; + contentParts: { + afterMore: string; + }; + seo: SEO; +}; + +export type Article = ArticlePreview & { + comments: Comment[]; + intro: string; + seo: SEO; +}; + +export type PostByResponse = { + postBy: ArticleResponse; +}; + +export type FetchPostByReturn = (slug: string) => Promise; + +export type GetPostByReturn = (slug: string) => Promise
; + +export type ArticleProps = { + post: Article; +}; + +export type ArticleSlug = { + slug: string; +}; -- cgit v1.2.3