From 52f03ad30f9eb8bc9b7552c33589e33929b88c5b Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Sat, 1 Jul 2023 18:51:31 -0400 Subject: [PATCH] fix empty metagame --- app/components/index-world.css.ts | 22 ++++++++++++++++++++++ app/components/index-world.tsx | 28 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/app/components/index-world.css.ts b/app/components/index-world.css.ts index ab5eda9..9f8f2e1 100644 --- a/app/components/index-world.css.ts +++ b/app/components/index-world.css.ts @@ -188,3 +188,25 @@ export const nextContText = style({ textTransform: "uppercase", marginRight: "0.5rem", }); + +export const oopsies = style({ + display: "flex", + flexDirection: "column", + alignItems: "center", + justifyContent: "center", + fontSize: "1.5rem", + height: "10rem", +}); + +const oopsiesSpinAnim = keyframes({ + from: { + transform: "rotate(0deg)", + }, + to: { + transform: "rotate(360deg)", + }, +}); + +export const oopsiesSpin = style({ + animation: `${oopsiesSpinAnim} 2s linear infinite`, +}); diff --git a/app/components/index-world.tsx b/app/components/index-world.tsx index c075f93..31a61f3 100644 --- a/app/components/index-world.tsx +++ b/app/components/index-world.tsx @@ -24,6 +24,11 @@ export type IndexWorldProps = { export const IndexWorld = ({ metagame, population }: IndexWorldProps) => { const worldId = metagame.id; const { platform, location, name } = worlds[String(worldId || "default")]; + + if (metagame.zones.length === 0) { + return ; + } + const nextZone = metagame.zones.sort( (a, b) => new Date(a.locked_since ?? Date.now()).getTime() - @@ -164,3 +169,26 @@ const Continent = ({ zone }: { zone: MetagameWorld["zones"][0] }) => { ); }; + +const BrokenWorld = ({ worldId }: { worldId: number }) => { + const { platform, location, name } = worlds[String(worldId || "default")]; + + return ( +
+ +
{name}
+
+ [{location}] [{platform}]{" "} +
+
DETAILS ⇨
+ +
+
+ Daybreak made an oopsie. +
+
🙂
+
+
+
+ ); +};