diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-23 00:20:08 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-23 00:24:39 +0100 |
| commit | 368fbbf83b913b90cef9dfbe4288e148d589d033 (patch) | |
| tree | e86d6006dec67ffe485cbab5141609759ce7d501 /src/components/PostFooter | |
| parent | 6d514259dd5e60af83b42f938ea9f6b017b7377f (diff) | |
refactor: rename all subject occurrences into topic
I change the name in graphql endpoint, so I decided to repercute this
change here.
Diffstat (limited to 'src/components/PostFooter')
| -rw-r--r-- | src/components/PostFooter/PostFooter.tsx | 25 |
1 files changed, 12 insertions, 13 deletions
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 ( - <li className={styles.item} key={subject.id}> - <ButtonLink target={`/sujet/${subject.slug}`}> - {subject.featuredImage && ( + <li className={styles.item} key={topic.id}> + <ButtonLink target={`/sujet/${topic.slug}`}> + {topic.featuredImage && ( <Image - src={subject.featuredImage.sourceUrl} - alt={subject.featuredImage.altText} + src={topic.featuredImage.sourceUrl} + alt={topic.featuredImage.altText} layout="intrinsic" width="20" height="20" /> )} - {subject.title} + {topic.title} </ButtonLink> </li> ); @@ -29,12 +28,12 @@ const PostFooter = ({ subjects }: { subjects: SubjectPreview[] }) => { return ( <footer> - {subjects.length > 0 && ( + {topics.length > 0 && ( <> <dl className={styles.meta}> <dt>{t`Read more articles about:`}</dt> <dd> - <ul className={styles.list}>{getSubjects()}</ul> + <ul className={styles.list}>{getTopics()}</ul> </dd> </dl> </> |
