From 05ca1bdf646ab3d2d48745147fe57e8f78e676de Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Thu, 30 Jul 2026 19:20:02 +0200 Subject: [PATCH] Update kids filters logic for clarity and consistency in label rendering --- web/components/filters/has-kids-filter.tsx | 5 +++-- web/components/filters/wants-kids-filter.tsx | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/web/components/filters/has-kids-filter.tsx b/web/components/filters/has-kids-filter.tsx index c77b4a7e..40397223 100644 --- a/web/components/filters/has-kids-filter.tsx +++ b/web/components/filters/has-kids-filter.tsx @@ -33,8 +33,9 @@ export function HasKidsLabel(props: { {/**/} - {has_kids === DEFAULT_KEY && t('filter.label.has_kids', 'Kids') + ': '} - {t(`profile.has_kids.${labelKey}`, labelValue)} + {has_kids === DEFAULT_KEY + ? t('filter.label.has_kids', 'Kids') + : t(`profile.has_kids.${labelKey}`, labelValue)} ) diff --git a/web/components/filters/wants-kids-filter.tsx b/web/components/filters/wants-kids-filter.tsx index 6b06425e..208ee7c6 100644 --- a/web/components/filters/wants-kids-filter.tsx +++ b/web/components/filters/wants-kids-filter.tsx @@ -62,7 +62,7 @@ export function KidsLabel(props: {strength: number; highlightedClass?: string; m const wantsKidsLabelsWithIcon = useWantsKidsLabelsWithIcon() const t = useT() - const strength = props.strength ? Number(props.strength) : DEFAULT_KEY + const strength = props.strength != null ? Number(props.strength) : DEFAULT_KEY return ( @@ -73,12 +73,13 @@ export function KidsLabel(props: {strength: number; highlightedClass?: string; m highlightedClass, )} > - {strength === DEFAULT_KEY && t('filter.label.wants_kids_strength', 'Wants Kids') + ': '} - {strength == wantsKidsLabelsWithIcon.no_preference.strength - ? wantsKidsLabelsWithIcon.no_preference.name - : strength == wantsKidsLabelsWithIcon.wants_kids.strength - ? wantsKidsLabelsWithIcon.wants_kids.name - : wantsKidsLabelsWithIcon.doesnt_want_kids.name} + {strength === DEFAULT_KEY + ? t('filter.label.wants_kids_strength', 'Desire for Kids') + : strength == wantsKidsLabelsWithIcon.no_preference.strength + ? wantsKidsLabelsWithIcon.no_preference.name + : strength == wantsKidsLabelsWithIcon.wants_kids.strength + ? wantsKidsLabelsWithIcon.wants_kids.name + : wantsKidsLabelsWithIcon.doesnt_want_kids.name} )