diff --git a/common/messages/de.json b/common/messages/de.json index 24356a2a..bc642924 100644 --- a/common/messages/de.json +++ b/common/messages/de.json @@ -1340,6 +1340,7 @@ "profile_grid.hide_profile": "Nicht mehr in den Suchergebnissen anzeigen", "profile_grid.no_profiles": "Keine Profile gefunden.", "profile_grid.notification_cta": "Klicken Sie gern auf „Benachrichtigen“, und wir informieren Sie, sobald neue Nutzer Ihrer Suche entsprechen.", + "profile_grid.searched_for": "Deine Suche", "profile_grid.profile_hidden_short": "Du wirst {name} nicht mehr in deinen Suchergebnissen sehen.", "profile_grid.undo": "Rückgängig", "profile_grid.unhide_profile": "Wieder in den Suchergebnissen anzeigen", diff --git a/common/messages/fr.json b/common/messages/fr.json index fb5794b1..7cdaf42d 100644 --- a/common/messages/fr.json +++ b/common/messages/fr.json @@ -1339,6 +1339,7 @@ "profile_grid.hide_profile": "Ne plus afficher dans les résultats de recherche", "profile_grid.no_profiles": "Aucun profil trouvé.", "profile_grid.notification_cta": "N'hésitez pas à cliquer sur \"Recevoir notifs\" et nous vous préviendrons quand de nouveaux utilisateurs correspondront à votre recherche !", + "profile_grid.searched_for": "Votre recherche", "profile_grid.profile_hidden_short": "Vous ne verrez plus {name} dans vos résultats de recherche.", "profile_grid.undo": "Annuler", "profile_grid.unhide_profile": "Afficher à nouveau dans les résultats de recherche", diff --git a/web/components/profile-grid.tsx b/web/components/profile-grid.tsx index 3640784d..fc27b77c 100644 --- a/web/components/profile-grid.tsx +++ b/web/components/profile-grid.tsx @@ -2,6 +2,7 @@ import {JSONContent} from '@tiptap/core' import clsx from 'clsx' import {INVERTED_DIET_CHOICES, INVERTED_LANGUAGE_CHOICES} from 'common/choices' import {FilterFields} from 'common/filters' +import {formatFilters, locationType} from 'common/filters-format' import {Gender} from 'common/gender' import {CompatibilityScore} from 'common/profiles/compatibility-score' import {Profile} from 'common/profiles/profile' @@ -40,6 +41,7 @@ import {BookmarkedSearchesType} from 'web/hooks/use-bookmarked-searches' import {useChoicesContext} from 'web/hooks/use-choices' import {ColumnCountOptions, useColumnCount} from 'web/hooks/use-column-count' import {useLongPressReveal} from 'web/hooks/use-long-press-reveal' +import {useMeasurementSystem} from 'web/hooks/use-measurement-system' import {isDark, useTheme} from 'web/hooks/use-theme' import {useUser} from 'web/hooks/use-user' import {useT} from 'web/lib/locale' @@ -268,6 +270,21 @@ export const ProfileGrid = (props: { const user = useUser() const t = useT() + const choicesIdsToLabels = useChoicesContext() + const {measurementSystem} = useMeasurementSystem() + + // Same summary the Saved Searches modal shows, so the empty state spells out what was searched. + const searchSummary = useMemo( + () => + formatFilters( + filters, + locationFilterProps?.location ? (locationFilterProps as unknown as locationType) : null, + choicesIdsToLabels, + measurementSystem, + t, + ) ?? [], + [filters, locationFilterProps, choicesIdsToLabels, measurementSystem, t], + ) const other_profiles = profiles.filter((profile) => profile.user_id !== user?.id) @@ -326,12 +343,23 @@ export const ProfileGrid = (props: {

{t('profile_grid.no_profiles', 'No profiles found')}

-

- {t( - 'profile_grid.notification_cta', - "We'll notify you as soon as someone new matches your search.", - )} -

+ {searchSummary.length > 0 && ( + +
+ {t('profile_grid.searched_for', 'Your search')} +
+ + {searchSummary.map((entry) => ( + + {entry} + + ))} + + + )} +

+ {t( + 'profile_grid.notification_cta', + "We'll notify you as soon as someone new matches your search.", + )} +

) )}