adding workspaces install

This commit is contained in:
Arjun Patel
2022-01-28 14:16:29 -08:00
parent a3e6f7cf5e
commit fdb3b78817
33 changed files with 6642 additions and 3 deletions
+3
View File
@@ -0,0 +1,3 @@
export enum CookieType {
TEAM_SHORTCUTS_ONBOARDING = "TEAM_SHORTCUTS_ONBOARDING",
}
+19
View File
@@ -0,0 +1,19 @@
import moment from "moment";
export function generateGreetings(): string {
const hour = moment().hour();
if (hour > 16) {
return "Good evening";
}
if (hour > 11) {
return "Good afternoon";
}
return "Good morning";
}
export function getTime(date?: Date) {
return date != null ? date.getTime() : 0;
}
+11
View File
@@ -0,0 +1,11 @@
export default function isValidHttpUrl(potentialUrl: string) {
let url;
try {
url = new URL(potentialUrl);
} catch (_) {
return false;
}
return url.protocol === "http:" || url.protocol === "https:";
}
+18
View File
@@ -0,0 +1,18 @@
import { User, UserStatus } from "../models/user";
function getStatusValue(status: UserStatus) {
switch (status) {
case UserStatus.online:
return 10;
case UserStatus.busy:
return 5;
case UserStatus.offline:
return 0;
default:
return -5;
}
}
export function compareStatus(usera: User, userb: User) {
return getStatusValue(userb.userStatus) - getStatusValue(usera.userStatus);
}