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
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Plus, Trash2, Star } from 'lucide-react';
|
||||
import { Plus, Trash2, Star, Loader2 } from 'lucide-react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
@@ -76,13 +76,14 @@ export function EntryCard({ entry, tmdbEntry }: EntryCardProps) {
|
||||
|
||||
const confirmRemove = () => {
|
||||
if (libraryEntry) {
|
||||
deleteEntry.mutate(libraryEntry.id);
|
||||
deleteEntry.mutate(libraryEntry.id, {
|
||||
onSettled: () => setShowConfirm(false),
|
||||
});
|
||||
}
|
||||
setShowConfirm(false);
|
||||
};
|
||||
|
||||
const card = (
|
||||
<div className="group relative overflow-hidden rounded-lg transition-all duration-200 hover:scale-[1.02] hover:shadow-xl">
|
||||
<div className="group relative overflow-hidden rounded-lg transition-all duration-300 hover:scale-[1.02] hover:shadow-xl animate-in fade-in zoom-in-95">
|
||||
{/* Poster */}
|
||||
<div className="relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-muted">
|
||||
<img
|
||||
@@ -129,9 +130,14 @@ export function EntryCard({ entry, tmdbEntry }: EntryCardProps) {
|
||||
variant="destructive"
|
||||
className="h-7 w-full text-xs"
|
||||
onClick={handleRemove}
|
||||
disabled={deleteEntry.isPending}
|
||||
>
|
||||
<Trash2 className="mr-1 h-3 w-3" />
|
||||
Remove
|
||||
{deleteEntry.isPending ? (
|
||||
<Loader2 className="mr-1 h-3 w-3 animate-spin" />
|
||||
) : (
|
||||
<Trash2 className="mr-1 h-3 w-3" />
|
||||
)}
|
||||
{deleteEntry.isPending ? 'Removing...' : 'Remove'}
|
||||
</Button>
|
||||
) : tmdbEntry ? (
|
||||
<Button
|
||||
@@ -140,7 +146,11 @@ export function EntryCard({ entry, tmdbEntry }: EntryCardProps) {
|
||||
onClick={handleAdd}
|
||||
disabled={createEntry.isPending}
|
||||
>
|
||||
<Plus className="mr-1 h-3 w-3" />
|
||||
{createEntry.isPending ? (
|
||||
<Loader2 className="mr-1 h-3 w-3 animate-spin" />
|
||||
) : (
|
||||
<Plus className="mr-1 h-3 w-3" />
|
||||
)}
|
||||
{createEntry.isPending ? 'Adding...' : 'Add to Library'}
|
||||
</Button>
|
||||
) : null}
|
||||
|
||||
Reference in new issue
Block a user