From 368fbbf83b913b90cef9dfbe4288e148d589d033 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
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 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

(limited to 'src/components/PostFooter/PostFooter.tsx')

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>
         </>
-- 
cgit v1.2.3

