All files / app/features/search constants.ts

100% Statements 14/14
66.66% Branches 4/6
100% Functions 2/2
100% Lines 6/6

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        2x   2x 6x 6x                 2x                 2x                          
import { TFunction } from "i18n";
import maplibregl from "maplibre-gl";
import { User } from "proto/api_pb";
import { UserSearchFilters } from "service/search";
import { firstName } from "utils/names";
 
export const aboutText = (user: User.AsObject, t: TFunction) => {
  const missingAbout = user.aboutMe.length === 0;
  return missingAbout
    ? t("search:search_result.missing_about_description", {
        name: firstName(user?.name),
      })
    : user.aboutMe.length < 300
    ? user.aboutMe
    : user.aboutMe.substring(0, 300) + "...";
};
 
export enum lastActiveOptions {
  LAST_ACTIVE_ANY = 0,
  LAST_ACTIVE_LAST_DAY = 1,
  LAST_ACTIVE_LAST_WEEK = 7,
  LAST_ACTIVE_LAST_2_WEEKS = 14,
  LAST_ACTIVE_LAST_MONTH = 31,
  LAST_ACTIVE_LAST_3_MONTHS = 93,
}
 
export const selectedUserZoom = 10;
 
export type Coordinates = [number, number, number, number];
 
export type MapClickedCallback = (
  ev: maplibregl.MapMouseEvent & {
    features?: maplibregl.MapboxGeoJSONFeature[] | undefined;
  } & maplibregl.EventData
) => void;
 
export interface SearchParams extends UserSearchFilters {
  location?: string;
}