feat(react): add toasts, loading states, skeletons, animations, and mobile responsiveness
- Toast notifications (sonner): success/error toasts on all mutations - Loading spinners: EntryCard add/remove, ConfirmDialog, EntrySeenDialog, favorite/refresh buttons - Page skeletons: 13 page-specific Suspense fallbacks replacing generic skeleton - CSS animations: card-enter (staggered), page-enter, slide-up-fade keyframes - Mobile layout: hamburger menu with sheet sidebar, responsive entry details - Mobile controls: separate compact filter/sort popovers for Library and Watchlist - Desktop sort: popover menu replacing Select dropdown on Library and Watchlist - Filter ranges: year 1950-2100, rating 0-10
This commit is contained in:
1 parent
ae67663623
commit
d60d142d17
29 files changed
+1008
-226
No files matched your search
@@ -75,7 +75,7 @@ export function Sidebar() {
|
||||
const { theme, toggleTheme } = useThemeStore();
|
||||
|
||||
return (
|
||||
<aside className="fixed inset-y-0 left-0 z-50 flex w-56 flex-col border-r border-sidebar-border bg-sidebar">
|
||||
<aside className="fixed inset-y-0 left-0 z-50 hidden md:flex w-56 flex-col border-r border-sidebar-border bg-sidebar">
|
||||
{/* Logo */}
|
||||
<div className="flex h-14 items-center gap-2 px-4">
|
||||
<Film className="h-6 w-6 text-sidebar-primary" />
|
||||
@@ -134,3 +134,95 @@ export function Sidebar() {
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
function MobileNavItem({
|
||||
to,
|
||||
icon: Icon,
|
||||
label,
|
||||
onClick,
|
||||
}: {
|
||||
to: string;
|
||||
icon: React.ComponentType<{ className?: string }>;
|
||||
label: string;
|
||||
onClick?: () => void;
|
||||
}) {
|
||||
return (
|
||||
<NavLink
|
||||
to={to}
|
||||
end={to === '/'}
|
||||
onClick={onClick}
|
||||
className={({ isActive }) =>
|
||||
`flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm transition-colors ${
|
||||
isActive
|
||||
? 'bg-sidebar-accent text-sidebar-primary font-medium'
|
||||
: 'text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground'
|
||||
}`
|
||||
}
|
||||
>
|
||||
<Icon className="h-4 w-4 shrink-0" />
|
||||
<span>{label}</span>
|
||||
</NavLink>
|
||||
);
|
||||
}
|
||||
|
||||
export function MobileSidebarContent({ onNavigate }: { onNavigate: () => void }) {
|
||||
const { theme, toggleTheme } = useThemeStore();
|
||||
|
||||
return (
|
||||
<div className="flex h-full flex-col bg-sidebar">
|
||||
{/* Logo */}
|
||||
<div className="flex h-14 items-center gap-2 px-4">
|
||||
<Film className="h-6 w-6 text-sidebar-primary" />
|
||||
<span className="text-lg font-bold text-sidebar-foreground">Showy</span>
|
||||
</div>
|
||||
|
||||
<Separator className="bg-sidebar-border" />
|
||||
|
||||
{/* Nav */}
|
||||
<nav className="flex-1 space-y-1 overflow-y-auto px-3 py-4">
|
||||
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/50">
|
||||
Main
|
||||
</p>
|
||||
{mainNav.map((item) => (
|
||||
<MobileNavItem key={item.to} {...item} onClick={onNavigate} />
|
||||
))}
|
||||
|
||||
<Separator className="my-3 bg-sidebar-border" />
|
||||
|
||||
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/50">
|
||||
Library
|
||||
</p>
|
||||
{libraryNav.map((item) => (
|
||||
<MobileNavItem key={item.to} {...item} onClick={onNavigate} />
|
||||
))}
|
||||
|
||||
<Separator className="my-3 bg-sidebar-border" />
|
||||
|
||||
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/50">
|
||||
Other
|
||||
</p>
|
||||
{otherNav.map((item) => (
|
||||
<MobileNavItem key={item.to} {...item} onClick={onNavigate} />
|
||||
))}
|
||||
</nav>
|
||||
|
||||
{/* Bottom actions */}
|
||||
<div className="border-t border-sidebar-border px-3 py-3 space-y-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="w-full justify-start gap-3 text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"
|
||||
onClick={toggleTheme}
|
||||
>
|
||||
{theme === 'dark' ? (
|
||||
<Sun className="h-4 w-4" />
|
||||
) : (
|
||||
<Moon className="h-4 w-4" />
|
||||
)}
|
||||
<span>{theme === 'dark' ? 'Light Mode' : 'Dark Mode'}</span>
|
||||
</Button>
|
||||
<MobileNavItem to="/settings" icon={Settings} label="Settings" onClick={onNavigate} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user