From 1a74d19cf4ad080e822e84472288c701ce001e60 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 11 Jan 2022 15:13:41 +0100
Subject: fix(widget): remove items limit for ThematicsList and TopicsList

By default WPGraphQL gets only the 10 first items if first is not
specified. So some subjects was not displayed.
I also add an order by title to the query. So I no longer need to sort
arrays inside components.
---
 src/components/Widget/ThematicsList/ThematicsList.tsx | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

(limited to 'src/components/Widget/ThematicsList/ThematicsList.tsx')

diff --git a/src/components/Widget/ThematicsList/ThematicsList.tsx b/src/components/Widget/ThematicsList/ThematicsList.tsx
index f120978..d17dbd1 100644
--- a/src/components/Widget/ThematicsList/ThematicsList.tsx
+++ b/src/components/Widget/ThematicsList/ThematicsList.tsx
@@ -17,11 +17,7 @@ const ThematicsList = ({ title }: { title: string }) => {
   if (error) return <div>{t`Failed to load.`}</div>;
   if (!data) return <div>{t`Loading...`}</div>;
 
-  const sortedThematics = [...data].sort((a, b) =>
-    a.title.localeCompare(b.title)
-  );
-
-  const thematics = sortedThematics.map((thematic) => {
+  const thematics = data.map((thematic) => {
     return currentThematicSlug !== thematic.slug ? (
       <li key={thematic.databaseId}>
         <Link href={`/thematique/${thematic.slug}`}>
-- 
cgit v1.2.3

