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/components/PostPreview/PostPreview.tsx | 4 +- src/pages/thematique/[slug].tsx | 77 +++++++++++++ src/services/graphql/taxonomies.ts | 166 +++++++++++++++++++++++++++++ src/styles/pages/Thematic.module.scss | 11 ++ src/ts/types/taxonomies.ts | 47 ++++++++ 5 files changed, 303 insertions(+), 2 deletions(-) create mode 100644 src/pages/thematique/[slug].tsx create mode 100644 src/services/graphql/taxonomies.ts create mode 100644 src/styles/pages/Thematic.module.scss (limited to 'src') diff --git a/src/components/PostPreview/PostPreview.tsx b/src/components/PostPreview/PostPreview.tsx index 3dfef73..95aca97 100644 --- a/src/components/PostPreview/PostPreview.tsx +++ b/src/components/PostPreview/PostPreview.tsx @@ -19,7 +19,7 @@ const PostPreview = ({ return (
- {post.featuredImage && ( + {post.featuredImage && Object.keys(post.featuredImage).length > 0 && (