Restyle the status page in Cottage's brand
The page (pages/, components/, styles/) is rewritten in Cottage's brand, replacing Mantine. - Brand files: tokens, fonts and component CSS copied from Hearth; logo, pod row, status pill and banner ported from the brand handbook. - Themes: light by default, dark when the OS asks. - Services: grouped; each has a status pill, uptime and 90 daily bars (30 on phones). - Bars: each bar has a text label, keyboard navigation and a day card. - Response-time chart: optional, drawn in brand colours. - Notices: colour-coded posted notices and planned maintenance. - Incident history: by month, with the brand's empty state. The check worker, D1 storage, types and Terraform are untouched, so upstream merges stay clean. uptime.config.ts lists Cottage's services (website, dashboard, apps in US East). `npm run dev` shows sample data (?sample=outage|maintenance|empty) since there's no D1. Deploys are gated on the CLOUDFLARE_DEPLOY repository variable until launch, Wrangler telemetry is off, and a Check workflow lints, type-checks and builds every pull request. Removed upstream's issue-translation workflow, funding file and translations.
This commit is contained in:
1 parent
8035521268
commit
fdc16007e3
54 files changed
+2197
-2705
No files matched your search
+33
-46
@@ -1,53 +1,40 @@
|
||||
import { Container, Group, Image } from '@mantine/core'
|
||||
import classes from '@/styles/Header.module.css'
|
||||
import Link from 'next/link'
|
||||
import { pageConfig } from '@/uptime.config'
|
||||
import { PageConfigLink } from '@/types/config'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export default function Header({ style }: { style?: React.CSSProperties }) {
|
||||
const { t } = useTranslation('common')
|
||||
const linkToElement = (link: PageConfigLink, i: number) => {
|
||||
return (
|
||||
<a
|
||||
key={i}
|
||||
href={link.link}
|
||||
target={link.link.startsWith('/') ? undefined : '_blank'}
|
||||
className={classes.link}
|
||||
data-active={link.highlight}
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
const links = [{ label: t('Incidents'), link: '/incidents' }, ...(pageConfig.links || [])]
|
||||
import { Logo } from './brand'
|
||||
|
||||
// The site header from the brand handbook (SiteHeader): lockup left, nav, actions right.
|
||||
export default function Header({ current }: { current: 'status' | 'incidents' }) {
|
||||
const nav = [
|
||||
{ key: 'status', label: 'Current status', href: '/' },
|
||||
{ key: 'incidents', label: 'Incident history', href: '/incidents' },
|
||||
]
|
||||
return (
|
||||
<header className={classes.header} style={style}>
|
||||
<Container size="md" className={classes.inner}>
|
||||
<div>
|
||||
<a
|
||||
href={location.pathname == '/' ? 'https://github.com/lyc8503/UptimeFlare' : '/'}
|
||||
target={location.pathname == '/' ? '_blank' : undefined}
|
||||
>
|
||||
<Image
|
||||
src={pageConfig.logo ?? '/logo.svg'}
|
||||
h={56}
|
||||
w={{ base: 140, sm: 190 }}
|
||||
fit="contain"
|
||||
alt="logo"
|
||||
/>
|
||||
</a>
|
||||
<header className="ct-site-header">
|
||||
<div className="ct-site-header__inner st-header">
|
||||
<Link href="/" className="ct-site-header__home st-header__home" aria-label="Cottage status, home">
|
||||
<Logo size={32} />
|
||||
<span className="st-header__tag">Status</span>
|
||||
</Link>
|
||||
<nav className="st-header__nav" aria-label="Status pages">
|
||||
{nav.map((l) => (
|
||||
<Link
|
||||
key={l.key}
|
||||
href={l.href}
|
||||
className={`ct-site-header__link${current === l.key ? ' is-current' : ''}`}
|
||||
aria-current={current === l.key ? 'page' : undefined}
|
||||
>
|
||||
{l.label}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
<div className="ct-site-header__actions st-header__actions">
|
||||
{(pageConfig.links || []).map((l) => (
|
||||
<a key={l.link} href={l.link} className={`ct-btn ct-btn--sm ${l.highlight ? 'ct-btn--secondary' : 'ct-btn--quiet'}`}>
|
||||
{l.label}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<Group gap={5} visibleFrom="sm">
|
||||
{links?.map(linkToElement)}
|
||||
</Group>
|
||||
|
||||
<Group gap={5} hiddenFrom="sm">
|
||||
{links?.filter((link) => link.highlight || link.link.startsWith('/')).map(linkToElement)}
|
||||
</Group>
|
||||
</Container>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user