Match gallery preview filters and tiles to gallery
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-14 16:07:29 +01:00
parent 289ef70e53
commit 33e46b448d

View File

@@ -111,33 +111,33 @@ export default function GalleryPreview({ token }: Props) {
</Link> </Link>
</div> </div>
<div className="flex gap-2 overflow-x-auto pb-1 text-sm font-medium [-ms-overflow-style:none] [scrollbar-width:none]"> <div className="flex overflow-x-auto pb-1 text-xs font-semibold [-ms-overflow-style:none] [scrollbar-width:none]">
{filters.map((filter) => { <div className="inline-flex items-center rounded-full border border-border/70 bg-white/80 p-1 shadow-sm backdrop-blur dark:border-white/10 dark:bg-slate-950/70">
{filters.map((filter, index) => {
const isActive = mode === filter.value; const isActive = mode === filter.value;
return ( return (
<div key={filter.value} className="flex items-center">
<button <button
key={filter.value}
type="button" type="button"
onClick={() => setMode(filter.value)} onClick={() => setMode(filter.value)}
style={{
borderRadius: radius,
border: isActive ? `1px solid ${branding.primaryColor}` : `1px solid ${branding.primaryColor}22`,
background: isActive ? branding.primaryColor : undefined,
boxShadow: isActive ? `0 8px 18px ${branding.primaryColor}33` : 'none',
}}
className={cn( className={cn(
'px-4 py-1 transition', 'inline-flex items-center rounded-full px-3 py-1.5 transition',
isActive isActive
? 'text-white' ? 'bg-pink-500 text-white shadow'
: 'bg-[var(--guest-surface)] text-foreground dark:bg-slate-950/70 dark:text-slate-100', : 'text-muted-foreground hover:bg-pink-50 hover:text-pink-600',
)} )}
> >
{filter.label} <span className="whitespace-nowrap">{filter.label}</span>
</button> </button>
{index < filters.length - 1 && (
<span className="mx-1 h-4 w-px bg-border/60 dark:bg-white/10" aria-hidden />
)}
</div>
); );
})} })}
</div> </div>
</div>
{loading && <p className="text-sm text-muted-foreground">Lädt</p>} {loading && <p className="text-sm text-muted-foreground">Lädt</p>}
{!loading && items.length === 0 && ( {!loading && items.length === 0 && (
@@ -147,37 +147,29 @@ export default function GalleryPreview({ token }: Props) {
</div> </div>
)} )}
<div className="grid gap-2 grid-cols-2 md:grid-cols-3"> <div className="grid gap-3 grid-cols-2 md:grid-cols-3">
{items.map((p: PreviewPhoto) => ( {items.map((p: PreviewPhoto) => (
<Link <Link
key={p.id} key={p.id}
to={`/e/${encodeURIComponent(token)}/gallery?photoId=${p.id}`} to={`/e/${encodeURIComponent(token)}/gallery?photoId=${p.id}`}
className="group relative block overflow-hidden bg-[var(--guest-surface)] text-foreground dark:bg-slate-950/70" className="group flex flex-col overflow-hidden border border-border/60 bg-white shadow-sm ring-1 ring-black/5 transition duration-300 hover:-translate-y-0.5 hover:shadow-lg dark:border-white/10 dark:bg-slate-950 dark:ring-white/10"
style={{ style={{ borderRadius: radius }}
borderRadius: radius,
border: `1px solid ${branding.primaryColor}22`,
boxShadow: `0 12px 26px ${branding.primaryColor}22`,
}}
> >
<div className="relative">
<img <img
src={p.thumbnail_path || p.file_path} src={p.thumbnail_path || p.file_path}
alt={p.title || 'Foto'} alt={p.title || 'Foto'}
className="h-40 w-full object-cover transition duration-300 group-hover:scale-105" className="aspect-[3/4] w-full object-cover transition duration-300 group-hover:scale-105"
loading="lazy" loading="lazy"
/> />
<div <div className="pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-black/50 via-black/0 to-transparent" aria-hidden />
className="absolute inset-0" </div>
style={{ <div className="space-y-2 px-3 pb-3 pt-3">
background: `linear-gradient(180deg, transparent 50%, ${branding.primaryColor}33 100%)`, <p className="text-sm font-semibold leading-tight line-clamp-2 text-foreground" style={headingFont ? { fontFamily: headingFont } : undefined}>
}}
aria-hidden
/>
<div className="absolute bottom-0 left-0 right-0 space-y-1 p-3">
<p className="text-sm font-semibold leading-tight line-clamp-2" style={headingFont ? { fontFamily: headingFont } : undefined}>
{p.title || getPhotoTitle(p)} {p.title || getPhotoTitle(p)}
</p> </p>
<div className="flex items-center gap-1 text-xs text-foreground/80"> <div className="flex items-center gap-1 text-xs text-muted-foreground">
<Heart className="h-4 w-4" style={{ color: branding.primaryColor }} aria-hidden /> <Heart className="h-3.5 w-3.5 text-pink-500" aria-hidden />
{p.likes_count ?? 0} {p.likes_count ?? 0}
</div> </div>
</div> </div>