mirror of
https://github.com/TheRealOwenRees/chess-scribe-website.git
synced 2026-07-23 01:46:57 +00:00
parse maintenance mode message
This commit is contained in:
@@ -36,7 +36,7 @@ jobs:
|
|||||||
VITE_API_BASE_URL=https://api.chess-scribe.org/api/v1
|
VITE_API_BASE_URL=https://api.chess-scribe.org/api/v1
|
||||||
VITE_MATOMO_URL=https://analytics.owenrees.eu
|
VITE_MATOMO_URL=https://analytics.owenrees.eu
|
||||||
VITE_MATOMO_SITE_ID="3"
|
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."
|
VITE_MAINTENANCE_MODE_MESSAGE="ChessScribe is currently undergoing maintenance. Some features may be unavailable."
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|||||||
@@ -1,17 +1,26 @@
|
|||||||
import { Link } from "@tanstack/react-router";
|
import { Link } from "@tanstack/react-router";
|
||||||
import { Image } from "@unpic/react";
|
import { Image } from "@unpic/react";
|
||||||
|
import { z } from "zod";
|
||||||
import MaintenanceModeBanner from "#/components/MaintenanceModeBanner.tsx";
|
import MaintenanceModeBanner from "#/components/MaintenanceModeBanner.tsx";
|
||||||
import { env } from "#/env.ts";
|
import { env } from "#/env.ts";
|
||||||
import logo from "@/assets/images/logo.svg?url";
|
import logo from "@/assets/images/logo.svg?url";
|
||||||
|
|
||||||
export default function Header() {
|
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 (
|
return (
|
||||||
<header>
|
<header>
|
||||||
{env.VITE_MAINTENANCE_MODE ? (
|
{maintenanceModeMessage ? (
|
||||||
<div className="absolute w-full">
|
<div className="absolute w-full">
|
||||||
<MaintenanceModeBanner message={env.VITE_MAINTENANCE_MODE_MESSAGE} />
|
<MaintenanceModeBanner message={maintenanceModeMessage} />
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<nav className="w-full max-w-screen-2xl place-self-center p-8">
|
<nav className="w-full max-w-screen-2xl place-self-center p-8">
|
||||||
<div className="container mx-auto flex items-center justify-between">
|
<div className="container mx-auto flex items-center justify-between">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
|
|||||||
Reference in New Issue
Block a user