feat(admin): Logo und Favicon per Bild-Upload austauschbar
Neue Gruppe "Logo und Favicon" unter Admin > Inhalte mit drei Bildfeldern: Logo (Kopfzeile), optionales Logo fuer dunkle Flaechen (Mobilmenue, Fusszeile, Admin-Leiste; faellt sonst auf das normale Logo zurueck) und Favicon. Leer bleibt alles wie bisher (gezeichnetes Waben-Zeichen bzw. Standard-Icon). - lib/brand.ts liest die Pfade und prueft sie erneut gegen das Upload-Muster, bevor sie in ein src-Attribut gelangen. - Statische app/icon.svg und app/favicon.ico ersetzt durch dynamische app/icon.tsx (512 px PNG) und app/apple-icon.tsx (180 px auf Creme); lib/brand-icon.ts rendert Upload oder Standard-Icon per sharp und liest Dateien nur ueber resolveUploadPath. Cache-Control no-cache, damit ein neues Favicon ohne Tage Verzoegerung erscheint. - /favicon.ico per Rewrite auf /icon, Manifest nutzt /icon. - Hochgeladenes Logo mit fester Hoehe und begrenzter Breite (Kopfzeile mobil 56 px, ab sm 112 px), damit breite Wortmarken nichts sprengen. Uploads bleiben auf Rasterbilder beschraenkt (kein SVG, XSS-Schutz). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
ae2726b0ee
commit
4f442ec06d
19 files changed
+217
-77
No files matched your search
@@ -147,10 +147,10 @@ function NavLinks({
|
||||
);
|
||||
}
|
||||
|
||||
function Wordmark() {
|
||||
function Wordmark({ logoSrc }: { logoSrc: string | null }) {
|
||||
return (
|
||||
<Link href="/admin" className="flex items-center gap-2">
|
||||
<Logomark className="h-7 w-7 flex-shrink-0" variant="inverted" />
|
||||
<Logomark className="h-7 w-7 flex-shrink-0" variant="inverted" src={logoSrc} />
|
||||
<span className="tracking-[0.15em] text-xs whitespace-nowrap">WABENHAIN ADMIN</span>
|
||||
</Link>
|
||||
);
|
||||
@@ -175,6 +175,8 @@ function PaletteTrigger({ onClick, label, shortcut }: { onClick: () => void; lab
|
||||
|
||||
interface AdminShellProps {
|
||||
adminName: string;
|
||||
/** Logo fuer dunkle Flaechen, siehe lib/brand.ts. */
|
||||
logoSrc?: string | null;
|
||||
badges?: AdminBadges;
|
||||
logoutAction: () => void | Promise<void>;
|
||||
children: ReactNode;
|
||||
@@ -188,7 +190,7 @@ interface AdminShellProps {
|
||||
* Shop-Kopf- und -Fusszeile blendet das Root-Layout hier aus
|
||||
* (components/hide-on-admin.tsx).
|
||||
*/
|
||||
export function AdminShell({ adminName, badges = {}, logoutAction, children }: AdminShellProps) {
|
||||
export function AdminShell({ adminName, logoSrc = null, badges = {}, logoutAction, children }: AdminShellProps) {
|
||||
const { t } = useI18n();
|
||||
const groups = getAdminNavGroups(t);
|
||||
const pathname = usePathname();
|
||||
@@ -219,7 +221,7 @@ export function AdminShell({ adminName, badges = {}, logoutAction, children }: A
|
||||
<aside className="relative isolate hidden overflow-hidden lg:flex lg:flex-col lg:w-64 lg:shrink-0 lg:sticky lg:top-0 lg:h-screen bg-forest text-cream">
|
||||
<HoneycombPattern className="-z-10 text-honey-light/[0.06]" size={18} fade="bottom" />
|
||||
<div className="flex items-center h-16 px-5 border-b border-cream/10">
|
||||
<Wordmark />
|
||||
<Wordmark logoSrc={logoSrc} />
|
||||
</div>
|
||||
<div className="pt-4">
|
||||
<PaletteTrigger
|
||||
@@ -236,7 +238,7 @@ export function AdminShell({ adminName, badges = {}, logoutAction, children }: A
|
||||
|
||||
<div className="flex-1 min-w-0">
|
||||
<header className="lg:hidden sticky top-0 z-30 bg-forest text-cream flex items-center justify-between h-16 px-5">
|
||||
<Wordmark />
|
||||
<Wordmark logoSrc={logoSrc} />
|
||||
<div className="flex items-center gap-1">
|
||||
<button
|
||||
aria-label={t.adminShell.paletteOpen}
|
||||
@@ -274,7 +276,7 @@ export function AdminShell({ adminName, badges = {}, logoutAction, children }: A
|
||||
className="lg:hidden fixed inset-0 z-50 bg-forest text-cream flex flex-col"
|
||||
>
|
||||
<div className="flex items-center justify-between h-16 px-5 border-b border-cream/10 flex-shrink-0">
|
||||
<Wordmark />
|
||||
<Wordmark logoSrc={logoSrc} />
|
||||
<button
|
||||
aria-label={t.adminShell.closeMenu}
|
||||
className="w-10 h-10 flex items-center justify-center flex-shrink-0"
|
||||
|
||||
Reference in new issue
Block a user