feat(ui): hide spoiler banner, anonymize claims, optional guest name, list wishlists on home, drop esgotados toggle

This commit is contained in:
belisards
2026-05-03 16:53:48 -03:00
parent ce7731cebb
commit c959cc8829
6 changed files with 43 additions and 65 deletions

View File

@@ -1,8 +1,5 @@
'use client';
import { useEffect, useState } from 'react';
import { authApi } from '@/lib/api';
interface HeaderProps {
title: string;
subtitle?: string;
@@ -12,33 +9,8 @@ interface HeaderProps {
}
export default function Header({ title, subtitle, imageUrl, actions, maxWidth = 'max-w-7xl' }: HeaderProps) {
const [isAdmin, setIsAdmin] = useState(false);
useEffect(() => {
let cancelled = false;
(async () => {
try {
const who = await authApi.whoami();
if (!cancelled) setIsAdmin(who.role === 'admin');
} catch {
if (!cancelled) setIsAdmin(false);
}
})();
return () => { cancelled = true; };
}, []);
return (
<>
{isAdmin && (
<div className="sticky top-0 z-50 bg-amber-50 dark:bg-amber-900/40 border-b border-amber-200/70 dark:border-amber-800/60 backdrop-blur">
<div className={`${maxWidth} mx-auto py-3 px-4 sm:px-6 lg:px-8`}>
<p className="text-center text-sm text-amber-900 dark:text-amber-100">
Atenção: visualizar listas públicas pode estragar surpresas
</p>
</div>
</div>
)}
<div className="relative overflow-hidden">
{/* Distant atmospheric haze */}
<div