HifiPlanet-Website/hifi-src/src/components/MaintenanceNotice.jsx
Maaxxs c17eee49cd Add login link to maintenance page, lock navbar to dark theme, link admin logo home
- MaintenanceNotice: the full-screen maintenance view now has a small
  "Anmelden"/"Log in" link fixed in the bottom-right corner, so a logged-out
  admin can reach /admin/login (and from there, maintenance-bypass access)
  without knowing the URL by heart.
- Navbar: wrapped in a permanently "dark" container so every dark: utility
  in it (background, borders, logo variant, icon colors, language-switcher
  dropdown) always applies regardless of the visitor's actual light/dark
  preference, per customer request. The real theme toggle still controls
  the rest of the site as before - only the navbar's own appearance is
  pinned. The portal-rendered mobile flyout menu is unaffected (it already
  had its own fixed light styling, independent of the toggle).
- AdminLayout: the dashboard's company logo (desktop sidebar and mobile top
  bar) is now a link to "/" instead of inert markup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 00:25:09 +02:00

47 lines
1.9 KiB
JavaScript

import { Link } from 'react-router-dom';
import { useLanguage } from '../context/LanguageContext.jsx';
import DynamicIcon from './DynamicIcon.jsx';
const WrenchIcon = () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" className="h-10 w-10">
<path strokeLinecap="round" strokeLinejoin="round" d="M14.7 6.3a4 4 0 0 0-5.5 4.5L3 17l2 2 6.2-6.2a4 4 0 0 0 4.5-5.5l-2.6 2.6-2-2 2.6-2.6Z" />
</svg>
);
export default function MaintenanceNotice({ message, fullScreen = false }) {
const { t } = useLanguage();
const content = (
<div className="mx-auto max-w-md text-center">
<div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400">
<WrenchIcon />
</div>
<h1 className="mb-2 text-xl font-bold text-neutral-900 dark:text-white">{t('maintenance.title')}</h1>
<p className="text-neutral-600 dark:text-neutral-300">
{message || t('maintenance.defaultMessage')}
</p>
</div>
);
if (fullScreen) {
return (
<div className="relative flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950">
{content}
<Link
to="/admin/login"
aria-label={t('maintenance.login')}
title={t('maintenance.login')}
className="fixed bottom-4 right-4 flex items-center gap-2 rounded-full border border-neutral-200 bg-white px-3 py-2 text-sm font-medium text-neutral-600 shadow-sm transition hover:border-brand-500 hover:text-brand-600 dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-300 dark:hover:text-brand-400"
>
<DynamicIcon name="log-in" className="h-4 w-4" />
{t('maintenance.login')}
</Link>
</div>
);
}
return (
<div className="mx-auto max-w-6xl px-4 py-20 sm:px-6">
{content}
</div>
);
}