aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Widget/ThematicsList/ThematicsList.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-11 15:13:41 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-11 15:33:04 +0100
commit1a74d19cf4ad080e822e84472288c701ce001e60 (patch)
tree83cb29cb510b52eacc90d84380eaf0f4d0d212ff /src/components/Widget/ThematicsList/ThematicsList.tsx
parentcb317554f8665bf1ce6aa18d02b12d19b0008269 (diff)
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.
Diffstat (limited to 'src/components/Widget/ThematicsList/ThematicsList.tsx')
-rw-r--r--src/components/Widget/ThematicsList/ThematicsList.tsx6
1 files changed, 1 insertions, 5 deletions
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}`}>