feat: complete UI design system refactoring and fix TS build errors

This commit is contained in:
Leon Tonhäuser committed 2026-08-11 03:38:34 +02:00
1 parent 0b1ffdfdfc
commit 8728308fc6
27 files changed
+847 -370

No files matched your search

+35 -30
View File
@@ -4,6 +4,8 @@ import { loadEditorialDownloadOptions } from "@/modules/downloads/stream";
import { lightboxService } from "@/modules/lightbox/service";
import type { ImmichSearchPage } from "@/modules/immich/types";
import Link from "next/link";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { requireEditorial } from "../access";
@@ -53,10 +55,10 @@ export default async function AlbumsPage({ searchParams }: { searchParams: Promi
const lightboxAssetIds = new Set(lightboxItems.map(i => i.assetId));
return (
<section className="editorial-section" aria-labelledby="albums-title">
<p className="editorial-kicker">Bildarchiv · Suche</p>
<div className="editorial-title-row">
<h1 id="albums-title">Suchergebnisse</h1>
<div className="space-y-6 max-w-7xl animate-in fade-in slide-in-from-bottom-4 duration-500" aria-labelledby="albums-title">
<div>
<p className="text-sm font-semibold uppercase tracking-widest text-primary-600 dark:text-primary-500 mb-2">Bildarchiv · Suche</p>
<h1 id="albums-title" className="text-4xl font-bold tracking-tight">Suchergebnisse</h1>
</div>
<GlobalSearchForm query={query} format={format} jahr={jahr} />
<PhotoContactSheet
@@ -68,7 +70,7 @@ export default async function AlbumsPage({ searchParams }: { searchParams: Promi
lightboxAssetIds={lightboxAssetIds}
/>
<GlobalSearchPagination page={results} query={query} />
</section>
</div>
);
}
@@ -79,19 +81,19 @@ export default async function AlbumsPage({ searchParams }: { searchParams: Promi
}
return (
<section className="editorial-section" aria-labelledby="albums-title">
<p className="editorial-kicker">Bildarchiv · Freigaben</p>
<div className="editorial-title-row">
<h1 id="albums-title">Ihre Alben</h1>
<p>Wählen Sie ein Spiel oder eine Serie, um die freigegebenen Fotos zu durchsuchen.</p>
<div className="space-y-8 max-w-7xl animate-in fade-in slide-in-from-bottom-4 duration-500" aria-labelledby="albums-title">
<div>
<p className="text-sm font-semibold uppercase tracking-widest text-primary-600 dark:text-primary-500 mb-2">Bildarchiv · Freigaben</p>
<h1 id="albums-title" className="text-4xl font-bold tracking-tight">Ihre Alben</h1>
<p className="text-muted-foreground mt-2">Wählen Sie ein Spiel oder eine Serie, um die freigegebenen Fotos zu durchsuchen.</p>
</div>
<GlobalSearchForm query={query} format={format} jahr={jahr} />
{result.albums.length === 0 ? (
<p className="catalog-empty">Für Ihre Redaktion sind noch keine Fotoalben freigegeben.</p>
<p className="text-muted-foreground text-center py-12">Für Ihre Redaktion sind noch keine Fotoalben freigegeben.</p>
) : (
<AlbumContactSheet albums={result.albums} />
)}
</section>
</div>
);
}
@@ -100,30 +102,29 @@ function GlobalSearchForm({ query, format, jahr }: { query: string; format?: str
const years = Array.from({ length: 10 }, (_, i) => currentYear - i);
return (
<form action="/redaktion/alben" className="global-search-form flex flex-wrap gap-4 items-center mb-8 bg-gray-50 p-4 rounded-xl border border-gray-200" role="search">
<div className="flex-grow">
<input
<form action="/redaktion/alben" className="flex flex-col sm:flex-row gap-4 items-center bg-card p-4 rounded-xl border border-border shadow-sm w-full" role="search">
<div className="flex-grow w-full sm:w-auto">
<Input
type="search"
name="suche"
defaultValue={query}
placeholder="Alle Alben durchsuchen..."
aria-label="Alle Alben durchsuchen"
className="w-full"
/>
</div>
<div className="flex gap-4">
<select name="format" defaultValue={format || ""} className="px-3 py-2 border border-gray-300 rounded-md">
<div className="flex gap-3 w-full sm:w-auto">
<select name="format" defaultValue={format || ""} className="flex h-10 w-full items-center justify-between rounded-md border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-50">
<option value="">Alle Formate</option>
<option value="quer">Querformat</option>
<option value="hoch">Hochformat</option>
</select>
<select name="jahr" defaultValue={jahr || ""} className="px-3 py-2 border border-gray-300 rounded-md">
<select name="jahr" defaultValue={jahr || ""} className="flex h-10 w-full items-center justify-between rounded-md border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-50">
<option value="">Alle Jahre</option>
{years.map(y => (
<option key={y} value={y.toString()}>{y}</option>
))}
</select>
<button type="submit">Suchen</button>
<Button type="submit" variant="default">Suchen</Button>
</div>
</form>
);
@@ -135,12 +136,12 @@ function GlobalSearchPagination({ page, query }: { page: ImmichSearchPage; query
}
return (
<nav aria-label="Suchergebnisseiten" className="photo-pagination">
{page.previousPage === null ? null : (
<Link href={`/redaktion/alben?suche=${encodeURIComponent(query)}&page=${page.previousPage}`}>Vorherige Seite</Link>
<nav aria-label="Suchergebnisseiten" className="flex justify-between items-center mt-8 pt-4 border-t border-border text-sm font-medium">
{page.previousPage === null ? <div /> : (
<Link className="text-primary-600 hover:underline" href={`/redaktion/alben?suche=${encodeURIComponent(query)}&page=${page.previousPage}`}>Vorherige Seite</Link>
)}
{page.nextPage === null ? null : (
<Link href={`/redaktion/alben?suche=${encodeURIComponent(query)}&page=${page.nextPage}`}>Nächste Seite</Link>
{page.nextPage === null ? <div /> : (
<Link className="text-primary-600 hover:underline" href={`/redaktion/alben?suche=${encodeURIComponent(query)}&page=${page.nextPage}`}>Nächste Seite</Link>
)}
</nav>
);
@@ -167,10 +168,14 @@ async function loadAlbums(editorialId: string) {
function ImmichUnavailable() {
return (
<section className="editorial-section editorial-state" aria-labelledby="albums-title">
<p className="editorial-kicker">Bildarchiv</p>
<h1 id="albums-title">Alben momentan nicht erreichbar</h1>
<p role="status">Bitte laden Sie diese Seite in wenigen Minuten erneut. Ihre Freigaben bleiben unverändert.</p>
</section>
<div className="space-y-6 max-w-7xl animate-in fade-in slide-in-from-bottom-4 duration-500" aria-labelledby="albums-title">
<div>
<p className="text-sm font-semibold uppercase tracking-widest text-primary-600 dark:text-primary-500 mb-2">Bildarchiv</p>
<h1 id="albums-title" className="text-4xl font-bold tracking-tight">Alben momentan nicht erreichbar</h1>
</div>
<div className="bg-destructive/15 text-destructive p-4 rounded-md border border-destructive/30" role="status">
Bitte laden Sie diese Seite in wenigen Minuten erneut. Ihre Freigaben bleiben unverändert.
</div>
</div>
);
}