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/Widgets/RelatedTopics/RelatedTopics.tsx | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'src/components/Widgets/RelatedTopics/RelatedTopics.tsx')

diff --git a/src/components/Widgets/RelatedTopics/RelatedTopics.tsx b/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
index aab8cc1..178e5bc 100644
--- a/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
+++ b/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
@@ -1,18 +1,18 @@
 import { ExpandableWidget, List } from '@components/WidgetParts';
 import { t } from '@lingui/macro';
-import { SubjectPreview } from '@ts/types/taxonomies';
+import { TopicPreview } from '@ts/types/taxonomies';
 import Link from 'next/link';
 
-const RelatedTopics = ({ topics }: { topics: SubjectPreview[] }) => {
-  const sortedSubjects = [...topics].sort((a, b) =>
+const RelatedTopics = ({ topics }: { topics: TopicPreview[] }) => {
+  const sortedTopics = [...topics].sort((a, b) =>
     a.title.localeCompare(b.title)
   );
 
-  const subjects = sortedSubjects.map((subject) => {
+  const topicsList = sortedTopics.map((topic) => {
     return (
-      <li key={subject.databaseId}>
-        <Link href={`/sujet/${subject.slug}`}>
-          <a>{subject.title}</a>
+      <li key={topic.databaseId}>
+        <Link href={`/sujet/${topic.slug}`}>
+          <a>{topic.title}</a>
         </Link>
       </li>
     );
@@ -20,10 +20,10 @@ const RelatedTopics = ({ topics }: { topics: SubjectPreview[] }) => {
 
   return (
     <ExpandableWidget
-      title={topics.length > 1 ? t`Related topics` : t`Related topic`}
+      title={topicsList.length > 1 ? t`Related topics` : t`Related topic`}
       withBorders={true}
     >
-      <List items={subjects} />
+      <List items={topicsList} />
     </ExpandableWidget>
   );
 };
-- 
cgit v1.2.3

