diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index f667772..70f3352 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -36,7 +36,7 @@ jobs: VITE_API_BASE_URL=https://api.chess-scribe.org/api/v1 VITE_MATOMO_URL=https://analytics.owenrees.eu VITE_MATOMO_SITE_ID="3" - VITE_MAINTENANCE_MODE="true" + VITE_MAINTENANCE_MODE="" VITE_MAINTENANCE_MODE_MESSAGE="ChessScribe is currently undergoing maintenance. Some features may be unavailable." deploy: diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 4513439..590efae 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,17 +1,26 @@ import { Link } from "@tanstack/react-router"; import { Image } from "@unpic/react"; +import { z } from "zod"; import MaintenanceModeBanner from "#/components/MaintenanceModeBanner.tsx"; import { env } from "#/env.ts"; import logo from "@/assets/images/logo.svg?url"; export default function Header() { + const maintenanceModeMessage = env.VITE_MAINTENANCE_MODE + ? z + .string() + .transform((value) => (value.trim() === "" ? null : value)) + .parse(env.VITE_MAINTENANCE_MODE_MESSAGE) + : null; + return (
- {env.VITE_MAINTENANCE_MODE ? ( + {maintenanceModeMessage ? (
- +
) : null} +