diff options
author | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
commit | b1d68ac307ed87d63e83820cbdf843fff0fd9f7f (patch) | |
tree | d6a684a70a80509e68ff667b842aa4e4c091906f /front/src/logic/constants.ts |
init
Diffstat (limited to 'front/src/logic/constants.ts')
-rw-r--r-- | front/src/logic/constants.ts | 36 |
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 = "📻"; |