From 368fbbf83b913b90cef9dfbe4288e148d589d033 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 23 Jan 2022 00:20:08 +0100 Subject: refactor: rename all subject occurrences into topic I change the name in graphql endpoint, so I decided to repercute this change here. --- src/components/PostFooter/PostFooter.tsx | 25 ++++--- src/components/PostMeta/PostMeta.tsx | 20 +++--- src/components/PostPreview/PostPreview.tsx | 2 +- .../Widgets/RelatedTopics/RelatedTopics.tsx | 18 ++--- src/components/Widgets/TopicsList/TopicsList.tsx | 16 ++--- src/pages/article/[slug].tsx | 4 +- src/pages/projet/[slug].tsx | 2 +- src/pages/sujet/[slug].tsx | 84 ++++++++++------------ src/pages/thematique/[slug].tsx | 22 +++--- src/services/graphql/queries.ts | 64 ++++++++--------- src/ts/types/app.ts | 16 ++--- src/ts/types/articles.ts | 16 ++--- src/ts/types/taxonomies.ts | 32 ++++----- src/utils/helpers/format.ts | 52 +++++++------- 14 files changed, 181 insertions(+), 192 deletions(-) (limited to 'src') diff --git a/src/components/PostFooter/PostFooter.tsx b/src/components/PostFooter/PostFooter.tsx index 06e86bc..ad471eb 100644 --- a/src/components/PostFooter/PostFooter.tsx +++ b/src/components/PostFooter/PostFooter.tsx @@ -1,26 +1,25 @@ import { ButtonLink } from '@components/Buttons'; import { t } from '@lingui/macro'; -import { SubjectPreview } from '@ts/types/taxonomies'; +import { TopicPreview } from '@ts/types/taxonomies'; import Image from 'next/image'; -import Link from 'next/link'; import styles from './PostFooter.module.scss'; -const PostFooter = ({ subjects }: { subjects: SubjectPreview[] }) => { - const getSubjects = () => { - return subjects.map((subject) => { +const PostFooter = ({ topics }: { topics: TopicPreview[] }) => { + const getTopics = () => { + return topics.map((topic) => { return ( -
  • - - {subject.featuredImage && ( +
  • + + {topic.featuredImage && ( {subject.featuredImage.altText} )} - {subject.title} + {topic.title}
  • ); @@ -29,12 +28,12 @@ const PostFooter = ({ subjects }: { subjects: SubjectPreview[] }) => { return (