summaryrefslogtreecommitdiffstats
path: root/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-29 12:13:34 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-29 18:30:05 +0200
commit7e16f500cb7bc0cfd8bafbf6bb1555704f771231 (patch)
treebfc2b4a475cb06a787e2c4bdf284165644e82952 /src/components/Widgets/RelatedTopics/RelatedTopics.tsx
parent5324664e87bedfaa01ba62c0c847ef5b861e69b3 (diff)
chore: remove old pages, components, helpers and types
Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch.
Diffstat (limited to 'src/components/Widgets/RelatedTopics/RelatedTopics.tsx')
-rw-r--r--src/components/Widgets/RelatedTopics/RelatedTopics.tsx41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/components/Widgets/RelatedTopics/RelatedTopics.tsx b/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
deleted file mode 100644
index 992173d..0000000
--- a/src/components/Widgets/RelatedTopics/RelatedTopics.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { ExpandableWidget, List } from '@components/WidgetParts';
-import { TopicPreview } from '@ts/types/taxonomies';
-import Link from 'next/link';
-import { useIntl } from 'react-intl';
-
-const RelatedTopics = ({ topics }: { topics: TopicPreview[] }) => {
- const intl = useIntl();
- const sortedTopics = [...topics].sort((a, b) =>
- a.title.localeCompare(b.title)
- );
-
- const topicsList = sortedTopics.map((topic) => {
- return (
- <li key={topic.databaseId}>
- <Link href={`/sujet/${topic.slug}`}>
- <a>{topic.title}</a>
- </Link>
- </li>
- );
- });
-
- return (
- <ExpandableWidget
- expand={true}
- title={intl.formatMessage(
- {
- defaultMessage:
- '{topicsCount, plural, =0 {Related topics} one {Related topic} other {Related topics}}',
- description: 'RelatedTopics: widget title',
- id: 'w/lPUh',
- },
- { topicsCount: topicsList.length }
- )}
- withBorders={true}
- >
- <List items={topicsList} />
- </ExpandableWidget>
- );
-};
-
-export default RelatedTopics;