From 9bf43462f243869bd1be8e42d3bd7d0eab3354a6 Mon Sep 17 00:00:00 2001 From: Kacper Wojciechowski <39823706+jog1t@users.noreply.github.com> Date: Mon, 4 Aug 2025 22:54:51 +0200 Subject: [PATCH] fix(hub): add missing dalas icon --- .../src/matchmaker/lobby-region.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/frontend/packages/components/src/matchmaker/lobby-region.tsx b/frontend/packages/components/src/matchmaker/lobby-region.tsx index 7ca7e46891..cf24742a3d 100644 --- a/frontend/packages/components/src/matchmaker/lobby-region.tsx +++ b/frontend/packages/components/src/matchmaker/lobby-region.tsx @@ -2,7 +2,7 @@ import { Icon, type IconProp, faComputer } from "@rivet-gg/icons"; import { AssetImage } from "../asset-image"; import { convertEmojiToUriFriendlyString } from "../lib/emoji"; -export const REGION_ICON: Record = { +export const REGION_ICON = { local: faComputer, unknown: "❓", atlanta: "🇺🇸", // Atlanta @@ -48,9 +48,10 @@ export const REGION_ICON: Record = { gru: "🇧🇷", // Sao Paulo bom: "🇮🇳", // Mumbai sin: "🇸🇬", // Singapore -}; + "tr-d": "🇺🇸", // Dallas +} satisfies Record; -export const REGION_LABEL: Record = { +export const REGION_LABEL = { local: "Local", unknown: "Unknown", atlanta: "Atlanta, Georgia, USA", @@ -96,19 +97,23 @@ export const REGION_LABEL: Record = { gru: "Sao Paulo", bom: "Mumbai, India", sin: "Singapore", -}; + "tr-d": "Dallas, Texas, USA", +} satisfies Record; -export function getRegionKey(regionNameId: string | undefined) { +export function getRegionKey( + regionNameId: string | undefined, +): keyof typeof REGION_ICON { // HACK: Remove prefix for old regions with format `lnd-atl` const regionIdSplit = (regionNameId || "").split("-"); - return regionIdSplit[regionIdSplit.length - 1]; + return regionIdSplit[regionIdSplit.length - 1] as keyof typeof REGION_ICON; } export function RegionIcon({ region = "", ...props }: { region: string | undefined; className?: string }) { - const regionIcon = REGION_ICON[region] ?? REGION_ICON.unknown; + const regionIcon = + REGION_ICON[region as keyof typeof REGION_ICON] ?? REGION_ICON.unknown; if (typeof regionIcon === "string") { return (