summaryrefslogtreecommitdiff
path: root/front/src/logic/constants.ts
diff options
context:
space:
mode:
Diffstat (limited to 'front/src/logic/constants.ts')
-rw-r--r--front/src/logic/constants.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/front/src/logic/constants.ts b/front/src/logic/constants.ts
new file mode 100644
index 0000000..fcf5573
--- /dev/null
+++ b/front/src/logic/constants.ts
@@ -0,0 +1,36 @@
+import type { Poast } from "@/types/trill";
+
+export const versionNum = "0.1.0";
+export const TIMEOUT = 15_000;
+
+export const ChatPostCount = 50;
+export const FeedPostCount = 50;
+export const RumorShip = "~londev-dozzod-sortug";
+export const RumorShip2 = "~paldev";
+
+export function isRumor(poast: Poast) {
+ return poast.author === RumorShip || poast.author === RumorShip2;
+}
+
+export const MOBILE_BROWSER_REGEX =
+ /Android|webOS|iPhone|iPad|iPod|BlackBerry/i;
+export const AUDIO_REGEX = new RegExp(/https:\/\/.+\.(mp3|wav|ogg)\b/gim);
+export const VIDEO_REGEX = new RegExp(/https:\/\/.+\.(mov|mp4|ogv)\b/gim);
+export const TWITTER_REGEX = new RegExp(
+ /https:\/\/(twitter|x)\.com\/.+\/status\/\d+/gim,
+);
+
+export const REF_REGEX = new RegExp(
+ /urbit:\/\/[a-z0-9-]+\/~[a-z-_]+\/[a-z0-9-_]+/gim,
+);
+export const RADIO_REGEX = new RegExp(/urbit:\/\/radio\/~[a-z-_]+/gim);
+
+export const IMAGE_REGEX = new RegExp(
+ /https:\/\/.+\.(jpg|img|png|gif|tiff|jpeg|webp|webm|svg)\b/gim,
+);
+
+export const SHIP_REGEX = new RegExp(/\B~[a-z-]+/);
+export const HASHTAGS_REGEX = new RegExp(/#[a-z-]+/g);
+
+export const DEFAULT_DATE = { year: 1970, month: 1, day: 1 };
+export const RADIO = "📻";