From 7e4f6064920aacd6420693fe9077a96b2a9e780a Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sat, 25 Oct 2025 14:36:55 +0200 Subject: [PATCH] Improve filter formatting for politics and religion --- web/components/filters/desktop-filters.tsx | 2 +- web/components/filters/mobile-filters.tsx | 2 +- web/components/filters/political-filter.tsx | 15 ++++++++------- web/components/filters/religion-filter.tsx | 10 ++++++++++ 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/web/components/filters/desktop-filters.tsx b/web/components/filters/desktop-filters.tsx index c8046e19..ea8a5612 100644 --- a/web/components/filters/desktop-filters.tsx +++ b/web/components/filters/desktop-filters.tsx @@ -366,7 +366,7 @@ export function DesktopFilters(props: { - convertPoliticalTypes(r) - ) - - if (length > 1) { + if (length > 2) { return ( @@ -32,6 +29,10 @@ export function PoliticalFilterText(props: { ) } + + const sortedOptions = getSortedOptions(options, POLITICAL_CHOICES) + const convertedTypes = sortedOptions.map((r) => convertPoliticalTypes(r as any)) + return (
diff --git a/web/components/filters/religion-filter.tsx b/web/components/filters/religion-filter.tsx index 81da1305..ec0c937e 100644 --- a/web/components/filters/religion-filter.tsx +++ b/web/components/filters/religion-filter.tsx @@ -21,6 +21,16 @@ export function ReligionFilterText(props: { ) } + if (length > 2) { + return ( + + + Multiple + + + ) + } + const sortedOptions = getSortedOptions(options, RELIGION_CHOICES) const convertedTypes = sortedOptions.map((r) => convertReligionTypes(r as any))