Update kids filters logic for clarity and consistency in label rendering

This commit is contained in:
MartinBraquet
2026-07-30 19:20:02 +02:00
parent 128897599c
commit 05ca1bdf64
2 changed files with 11 additions and 9 deletions

View File

@@ -33,8 +33,9 @@ export function HasKidsLabel(props: {
<Row className="items-center gap-0.5">
{/*<FaChild className="h-4 w-4" />*/}
<span className={clsx(highlightedClass, has_kids !== DEFAULT_KEY && 'font-semibold')}>
{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)}
</span>
</Row>
)

View File

@@ -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 (
<Row className="items-center gap-0.5">
@@ -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}
</span>
</Row>
)