diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-16 23:20:58 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-16 23:20:58 +0100 |
| commit | 8a703cb39ff23ff3639b0da33f0d72f92f1cc55b (patch) | |
| tree | e898046c472839f36e306d8ae9aa7efc58ba98cd /src/ts | |
| parent | 89bf1e53fda306d271676bda4605794567b7f3b6 (diff) | |
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.
Diffstat (limited to 'src/ts')
| -rw-r--r-- | src/ts/types/taxonomies.ts | 47 |
1 files changed, 47 insertions, 0 deletions
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<ThematicByResponse>; + +export type GetTaxonomyByReturn = (slug: string) => Promise<Taxonomy>; + +export type FetchAllTaxonomiesSlugReturn = () => Promise<AllTaxonomiesSlug[]>; |
