mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-28 11:34:03 -04:00
Format last active filter
This commit is contained in:
@@ -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