diff --git a/common/messages/de.json b/common/messages/de.json index 177af481..dc6aeaf5 100644 --- a/common/messages/de.json +++ b/common/messages/de.json @@ -333,6 +333,7 @@ "filter.label.diet": "Ernährung", "filter.label.drinks": "Getränke", "filter.label.education_levels": "Bildung", + "filter.label.last_active": "Aktiv", "filter.label.mbti": "MBTI", "filter.label.name": "Suche", "filter.label.political_beliefs": "Politische Ansichten", diff --git a/common/messages/fr.json b/common/messages/fr.json index e52895b4..4d16319c 100644 --- a/common/messages/fr.json +++ b/common/messages/fr.json @@ -354,6 +354,7 @@ "filter.relationship_status.any": "Tout statut romantique", "filter.last_active.any": "N'importe quand", "filter.last_active.label": "Actif", + "filter.label.last_active": "Actif", "filter.last_active.today": "Aujourd'hui", "filter.last_active.3days": "3 derniers jours", "filter.last_active.week": "Dernière semaine", diff --git a/common/src/choices.ts b/common/src/choices.ts index 55d6f95c..e1c7c3e5 100644 --- a/common/src/choices.ts +++ b/common/src/choices.ts @@ -233,7 +233,7 @@ export const LAST_ONLINE_CHOICES = { month: 'Last month', '3months': 'Last 3 months', any: 'Any time', -} +} as const export const INVERTED_RELATIONSHIP_CHOICES = invert(RELATIONSHIP_CHOICES) export const INVERTED_RELATIONSHIP_STATUS_CHOICES = invert(RELATIONSHIP_STATUS_CHOICES) diff --git a/common/src/filters-format.ts b/common/src/filters-format.ts index 74181d57..d9b025be 100644 --- a/common/src/filters-format.ts +++ b/common/src/filters-format.ts @@ -9,6 +9,7 @@ import { INVERTED_RELATIONSHIP_STATUS_CHOICES, INVERTED_RELIGION_CHOICES, INVERTED_ROMANTIC_CHOICES, + LAST_ONLINE_CHOICES, } from 'common/choices' import {FilterFields, initialFilters} from 'common/filters' import {hasKidsNames} from 'common/has-kids' @@ -40,6 +41,7 @@ const filterLabels: Record = { political_beliefs: 'Political views', languages: '', mbti: 'MBTI', + last_active: 'Active', } export type locationType = { @@ -141,6 +143,12 @@ export function formatFilters( `profile.smoker.${value ? 'yes' : 'no'}`, value ? 'Smoker' : 'Non-smoker', ) + else if (key === 'last_active') + stringValue = translate( + `filter.last_active.${value}`, + LAST_ONLINE_CHOICES[value as keyof typeof LAST_ONLINE_CHOICES] ?? value, + ) + if (Array.isArray(value)) { if (choicesIdsToLabels[key]) { value = value.map((id) => choicesIdsToLabels[key][id])