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>
This commit is contained in:
parent
17f331c35e
commit
c17eee49cd
8 changed files with 51 additions and 33 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { NavLink, Outlet, useNavigate } from 'react-router-dom';
|
import { Link, NavLink, Outlet, useNavigate } from 'react-router-dom';
|
||||||
import { useAuth } from '../context/AuthContext.jsx';
|
import { useAuth } from '../context/AuthContext.jsx';
|
||||||
import { api } from '../api/client.js';
|
import { api } from '../api/client.js';
|
||||||
import ThemeToggle from './ThemeToggle.jsx';
|
import ThemeToggle from './ThemeToggle.jsx';
|
||||||
|
|
@ -131,10 +131,10 @@ export default function AdminLayout() {
|
||||||
<div className="flex min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100">
|
<div className="flex min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100">
|
||||||
<aside className="hidden w-60 shrink-0 border-r border-neutral-200 p-4 dark:border-neutral-800 sm:block">
|
<aside className="hidden w-60 shrink-0 border-r border-neutral-200 p-4 dark:border-neutral-800 sm:block">
|
||||||
<div className="mb-6 flex items-center gap-2 px-3">
|
<div className="mb-6 flex items-center gap-2 px-3">
|
||||||
<span className="rounded-lg px-2 py-1">
|
<Link to="/" className="rounded-lg px-2 py-1">
|
||||||
<img src={logo} alt="HifiPlanet" className="h-7 w-auto dark:hidden" />
|
<img src={logo} alt="HifiPlanet" className="h-7 w-auto dark:hidden" />
|
||||||
<img src={logoDark} alt="HifiPlanet" className="hidden h-7 w-auto dark:block" />
|
<img src={logoDark} alt="HifiPlanet" className="hidden h-7 w-auto dark:block" />
|
||||||
</span>
|
</Link>
|
||||||
<span className="text-sm font-semibold text-neutral-500 dark:text-neutral-400">Admin</span>
|
<span className="text-sm font-semibold text-neutral-500 dark:text-neutral-400">Admin</span>
|
||||||
</div>
|
</div>
|
||||||
<NavLinks />
|
<NavLinks />
|
||||||
|
|
@ -153,10 +153,10 @@ export default function AdminLayout() {
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" d="M4 6h16M4 12h16M4 18h16" />
|
<path strokeLinecap="round" strokeLinejoin="round" d="M4 6h16M4 12h16M4 18h16" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<span className="rounded-lg px-1.5 py-0.5">
|
<Link to="/" className="rounded-lg px-1.5 py-0.5">
|
||||||
<img src={logo} alt="HifiPlanet" className="h-6 w-auto dark:hidden" />
|
<img src={logo} alt="HifiPlanet" className="h-6 w-auto dark:hidden" />
|
||||||
<img src={logoDark} alt="HifiPlanet" className="hidden h-6 w-auto dark:block" />
|
<img src={logoDark} alt="HifiPlanet" className="hidden h-6 w-auto dark:block" />
|
||||||
</span>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<p className="hidden text-sm text-neutral-500 dark:text-neutral-400 sm:block">
|
<p className="hidden text-sm text-neutral-500 dark:text-neutral-400 sm:block">
|
||||||
Angemeldet als {user?.username}{user?.is_super_admin ? ' · Super-Admin' : ''}
|
Angemeldet als {user?.username}{user?.is_super_admin ? ' · Super-Admin' : ''}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import { useLanguage } from '../context/LanguageContext.jsx';
|
import { useLanguage } from '../context/LanguageContext.jsx';
|
||||||
|
import DynamicIcon from './DynamicIcon.jsx';
|
||||||
|
|
||||||
const WrenchIcon = () => (
|
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">
|
<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">
|
||||||
|
|
@ -22,8 +24,17 @@ export default function MaintenanceNotice({ message, fullScreen = false }) {
|
||||||
|
|
||||||
if (fullScreen) {
|
if (fullScreen) {
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950">
|
<div className="relative flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950">
|
||||||
{content}
|
{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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,13 +191,17 @@ export default function Navbar() {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header
|
// "dark" hier erzwungen (nicht vom eigentlichen Seiten-Theme abhaengig) - Kundenwunsch:
|
||||||
className={`sticky top-0 z-30 border-b transition-colors duration-300 ${
|
// die Navbar soll immer im Dark-Theme bleiben, unabhaengig vom Light-/Dark-Mode-Toggle
|
||||||
transparent
|
// des Besuchers. Alle dark:-Utilities in diesem Bereich greifen dadurch immer.
|
||||||
? 'border-transparent bg-transparent'
|
<div className="dark">
|
||||||
: 'border-neutral-200 bg-white/90 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/90'
|
<header
|
||||||
}`}
|
className={`sticky top-0 z-30 border-b transition-colors duration-300 ${
|
||||||
>
|
transparent
|
||||||
|
? 'border-transparent bg-transparent'
|
||||||
|
: 'border-neutral-200 bg-white/90 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/90'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
<div className="mx-auto grid max-w-6xl grid-cols-[1fr_auto_1fr] items-center gap-3 px-4 py-3 sm:px-6">
|
<div className="mx-auto grid max-w-6xl grid-cols-[1fr_auto_1fr] items-center gap-3 px-4 py-3 sm:px-6">
|
||||||
<div className="flex items-center justify-self-start">
|
<div className="flex items-center justify-self-start">
|
||||||
<button
|
<button
|
||||||
|
|
@ -292,6 +296,7 @@ export default function Navbar() {
|
||||||
</div>,
|
</div>,
|
||||||
document.body
|
document.body
|
||||||
)}
|
)}
|
||||||
</header>
|
</header>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ export default {
|
||||||
maintenance: {
|
maintenance: {
|
||||||
title: 'Wartungsarbeiten',
|
title: 'Wartungsarbeiten',
|
||||||
defaultMessage: 'Dieser Bereich wird gerade aktualisiert. Bitte schau in Kürze wieder vorbei.',
|
defaultMessage: 'Dieser Bereich wird gerade aktualisiert. Bitte schau in Kürze wieder vorbei.',
|
||||||
|
login: 'Anmelden',
|
||||||
},
|
},
|
||||||
lightbox: {
|
lightbox: {
|
||||||
close: 'Schließen',
|
close: 'Schließen',
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ export default {
|
||||||
maintenance: {
|
maintenance: {
|
||||||
title: 'Under maintenance',
|
title: 'Under maintenance',
|
||||||
defaultMessage: 'This area is currently being updated. Please check back shortly.',
|
defaultMessage: 'This area is currently being updated. Please check back shortly.',
|
||||||
|
login: 'Log in',
|
||||||
},
|
},
|
||||||
lightbox: {
|
lightbox: {
|
||||||
close: 'Close',
|
close: 'Close',
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -43,9 +43,9 @@
|
||||||
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-CBt-zBNW.js"></script>
|
<script type="module" crossorigin src="/assets/index-D5DdJjJZ.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/assets/lucide-icons-Cg2IxtAO.js">
|
<link rel="modulepreload" crossorigin href="/assets/lucide-icons-Cg2IxtAO.js">
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-DSF_8N3Q.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CV-knTge.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue