mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-24 17:41:27 -04:00
Format last active filter
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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<string, string> = {
|
||||
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])
|
||||
|
||||
Reference in New Issue
Block a user