feat: customize site banners and login notices
Magent CI/CD / verify (push) Successful in 1m55s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Successful in 49s

This commit is contained in:
2026-09-16 14:22:38 +12:00
parent 3465343a69
commit d75f36c691
12 changed files with 239 additions and 20 deletions
+8 -2
View File
@@ -1,12 +1,14 @@
'use client'
import { useEffect, useState } from 'react'
import { useEffect, useState, type CSSProperties } from 'react'
import { authFetch, clearToken, getApiBase, getToken } from '../lib/auth'
type BannerInfo = {
enabled: boolean
message: string
tone?: string
backgroundColor?: string | null
borderColor?: string | null
}
type SiteInfo = {
@@ -52,10 +54,14 @@ export default function SiteStatus() {
const banner = info?.banner
const tone = banner?.tone || 'info'
const bannerStyle = {
'--site-banner-background-color': banner?.backgroundColor || undefined,
'--site-banner-border-color': banner?.borderColor || undefined,
} as CSSProperties
return (
<>
{banner?.enabled && banner.message ? (
<div className={`site-banner site-banner--${tone}`}>{banner.message}</div>
<div className={`site-banner site-banner--${tone}`} style={bannerStyle}>{banner.message}</div>
) : null}
</>
)