From 8a703cb39ff23ff3639b0da33f0d72f92f1cc55b Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 16 Dec 2021 23:20:58 +0100 Subject: chore: create thematic page view For now I have to repeat some markup/styles, I cannot reuse PostsList component. WP GraphQL does not offer edges for ACF Post2Post or filters to get thematic posts with another way. I should create custom fields in backend to improve the posts fetching. --- src/ts/types/taxonomies.ts | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'src/ts/types') diff --git a/src/ts/types/taxonomies.ts b/src/ts/types/taxonomies.ts index dd45852..d090e2d 100644 --- a/src/ts/types/taxonomies.ts +++ b/src/ts/types/taxonomies.ts @@ -1,3 +1,4 @@ +import { ArticlePreview, ArticlePreviewResponse } from './articles'; import { Cover } from './cover'; type TaxonomyPreview = { @@ -7,8 +8,54 @@ type TaxonomyPreview = { title: string; }; +export type Taxonomy = TaxonomyPreview & { + content: string; + date: string; + intro: string; + modified: string; + posts: ArticlePreview[]; +}; + export type SubjectPreview = TaxonomyPreview & { cover: Cover; }; export type ThematicPreview = TaxonomyPreview; + +export type ThematicResponse = TaxonomyPreview & { + acfThematics: { + postsInThematic: ArticlePreviewResponse[]; + }; + contentParts: { + afterMore: string; + beforeMore: string; + }; + date: string; + modified: string; +}; + +export type ThematicProps = { + thematic: Taxonomy; +}; + +export type AllTaxonomiesSlug = { + slug: string; +}; + +export type AllTaxonomiesSlugResponse = { + thematics: { + nodes: AllTaxonomiesSlug[]; + }; +}; + +export type ThematicByResponse = { + thematicBy: ThematicResponse; +}; + +export type FetchThematicByReturn = ( + slug: string +) => Promise; + +export type GetTaxonomyByReturn = (slug: string) => Promise; + +export type FetchAllTaxonomiesSlugReturn = () => Promise; -- cgit v1.2.3