Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x | import { TFunction } from "i18n";
import { SleepingArrangement } from "proto/api_pb";
import { SearchUser } from "proto/search_pb";
import { firstName } from "utils/names";
const aboutText = (user: SearchUser.AsObject, t: TFunction) => {
const missingAbout = user.profileSnippet.length === 0;
return missingAbout
? t("search:search_result.missing_about_description", {
name: firstName(user?.name),
})
: user.profileSnippet;
};
const truncateWithEllipsis = (str: string, maxLength = 40): string =>
str.length > maxLength ? str.slice(0, maxLength) + "…" : str;
enum lastActiveOptions {
LAST_ACTIVE_ANY = 0,
LAST_ACTIVE_LAST_WEEK = 7,
LAST_ACTIVE_LAST_MONTH = 31,
LAST_ACTIVE_LAST_3_MONTHS = 93,
LAST_ACTIVE_LAST_SIX_MONTHS = 183,
LAST_ACTIVE_LAST_YEAR = 365,
}
type Coordinates = [number, number, number, number];
type SleepingArrangementOptions =
| SleepingArrangement.SLEEPING_ARRANGEMENT_COMMON
| SleepingArrangement.SLEEPING_ARRANGEMENT_PRIVATE
| SleepingArrangement.SLEEPING_ARRANGEMENT_SHARED_ROOM;
const DEFAULT_AGE_MIN = 18;
const DEFAULT_AGE_MAX = 120;
const MAX_MAP_ZOOM_LEVEL_FOR_SEARCH = 8;
type MapSearchTypes = "location" | "keyword";
enum MapViews {
MAP_AND_LIST = "MAP_AND_LIST",
LIST_ONLY = "LIST_ONLY",
}
type MapViewOptions = MapViews.MAP_AND_LIST | MapViews.LIST_ONLY;
const MAX_ZOOM_LEVEL = 15;
const MIN_ZOOM_LEVEL = 0;
export {
aboutText,
DEFAULT_AGE_MAX,
DEFAULT_AGE_MIN,
lastActiveOptions,
MapViews,
MAX_MAP_ZOOM_LEVEL_FOR_SEARCH,
MAX_ZOOM_LEVEL,
MIN_ZOOM_LEVEL,
truncateWithEllipsis,
};
export type {
Coordinates,
MapSearchTypes,
MapViewOptions,
SleepingArrangementOptions,
};
|