diff --git a/react_frontend/package-lock.json b/react_frontend/package-lock.json index 6154dce..356b783 100644 --- a/react_frontend/package-lock.json +++ b/react_frontend/package-lock.json @@ -24,6 +24,7 @@ "react-router-dom": "^7.13.2", "recharts": "^3.8.1", "shadcn": "^4.1.1", + "sonner": "^2.0.7", "tailwind-merge": "^3.5.0", "tw-animate-css": "^1.4.0", "zod": "^4.3.6", @@ -6814,6 +6815,16 @@ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "license": "MIT" }, + "node_modules/sonner": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz", + "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==", + "license": "MIT", + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", + "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", diff --git a/react_frontend/package.json b/react_frontend/package.json index a85e342..bae5300 100644 --- a/react_frontend/package.json +++ b/react_frontend/package.json @@ -26,6 +26,7 @@ "react-router-dom": "^7.13.2", "recharts": "^3.8.1", "shadcn": "^4.1.1", + "sonner": "^2.0.7", "tailwind-merge": "^3.5.0", "tw-animate-css": "^1.4.0", "zod": "^4.3.6", diff --git a/react_frontend/src/App.tsx b/react_frontend/src/App.tsx index 440609d..a5de598 100644 --- a/react_frontend/src/App.tsx +++ b/react_frontend/src/App.tsx @@ -1,6 +1,7 @@ import { RouterProvider } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { TooltipProvider } from '@/components/ui/tooltip'; +import { Toaster } from '@/components/ui/sonner'; import { router } from './router'; const queryClient = new QueryClient({ @@ -18,6 +19,7 @@ export function App() { + ); diff --git a/react_frontend/src/components/collections/CollectionsGrid.tsx b/react_frontend/src/components/collections/CollectionsGrid.tsx index 5aab80c..b06a601 100644 --- a/react_frontend/src/components/collections/CollectionsGrid.tsx +++ b/react_frontend/src/components/collections/CollectionsGrid.tsx @@ -63,8 +63,14 @@ export function CollectionsGrid({ return (
- {collections.map((collection) => ( - + {collections.map((collection, index) => ( +
+ +
))}
); diff --git a/react_frontend/src/components/dialogs/ConfirmDialog.tsx b/react_frontend/src/components/dialogs/ConfirmDialog.tsx index ddcf8ea..83cdc2b 100644 --- a/react_frontend/src/components/dialogs/ConfirmDialog.tsx +++ b/react_frontend/src/components/dialogs/ConfirmDialog.tsx @@ -7,6 +7,7 @@ import { DialogTitle, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; +import { Loader2 } from 'lucide-react'; interface ConfirmDialogProps { open: boolean; @@ -17,6 +18,7 @@ interface ConfirmDialogProps { cancelLabel?: string; onConfirm: () => void; variant?: 'default' | 'destructive'; + isLoading?: boolean; } export function ConfirmDialog({ @@ -28,6 +30,7 @@ export function ConfirmDialog({ cancelLabel = 'Cancel', onConfirm, variant = 'default', + isLoading = false, }: ConfirmDialogProps) { return ( @@ -37,13 +40,15 @@ export function ConfirmDialog({ {description} - diff --git a/react_frontend/src/components/dialogs/EntrySeenDialog.tsx b/react_frontend/src/components/dialogs/EntrySeenDialog.tsx index a70f994..497d820 100644 --- a/react_frontend/src/components/dialogs/EntrySeenDialog.tsx +++ b/react_frontend/src/components/dialogs/EntrySeenDialog.tsx @@ -3,7 +3,7 @@ import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; import { format } from 'date-fns'; -import { CalendarIcon } from 'lucide-react'; +import { CalendarIcon, Loader2 } from 'lucide-react'; import { Dialog, DialogContent, @@ -239,10 +239,17 @@ export function EntrySeenDialog({ type="button" variant="outline" onClick={() => onOpenChange(false)} + disabled={createEntrySeen.isPending || updateEntrySeen.isPending || createEpisodeSeen.isPending} > Cancel - diff --git a/react_frontend/src/components/entries/EntryCard.tsx b/react_frontend/src/components/entries/EntryCard.tsx index e697399..35f6652 100644 --- a/react_frontend/src/components/entries/EntryCard.tsx +++ b/react_frontend/src/components/entries/EntryCard.tsx @@ -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 = ( -
+
{/* Poster */}
- - Remove + {deleteEntry.isPending ? ( + + ) : ( + + )} + {deleteEntry.isPending ? 'Removing...' : 'Remove'} ) : tmdbEntry ? ( ) : null} diff --git a/react_frontend/src/components/entries/EntryLibraryGrid.tsx b/react_frontend/src/components/entries/EntryLibraryGrid.tsx index 6fd8037..dee1ff1 100644 --- a/react_frontend/src/components/entries/EntryLibraryGrid.tsx +++ b/react_frontend/src/components/entries/EntryLibraryGrid.tsx @@ -59,6 +59,8 @@ export function EntryLibraryGrid({
diff --git a/react_frontend/src/components/entries/TrendingGrid.tsx b/react_frontend/src/components/entries/TrendingGrid.tsx index 494afde..ce3959a 100644 --- a/react_frontend/src/components/entries/TrendingGrid.tsx +++ b/react_frontend/src/components/entries/TrendingGrid.tsx @@ -61,8 +61,14 @@ export function TrendingGrid({
) : (
- {displayEntries.map((tmdbEntry) => ( - + {displayEntries.map((tmdbEntry, index) => ( +
+ +
))}
)} diff --git a/react_frontend/src/components/layout/AppLayout.tsx b/react_frontend/src/components/layout/AppLayout.tsx index 62e58c4..f089a2c 100644 --- a/react_frontend/src/components/layout/AppLayout.tsx +++ b/react_frontend/src/components/layout/AppLayout.tsx @@ -1,12 +1,45 @@ import { Outlet } from 'react-router-dom'; -import { Sidebar } from './Sidebar'; +import { useState } from 'react'; +import { Menu } from 'lucide-react'; +import { Button } from '@/components/ui/button'; +import { + Sheet, + SheetContent, + SheetHeader, + SheetTitle, +} from '@/components/ui/sheet'; +import { Sidebar, MobileSidebarContent } from './Sidebar'; export function AppLayout() { + const [mobileOpen, setMobileOpen] = useState(false); + return (
- -
-
+ {/* Desktop sidebar */} +
+ +
+ + {/* Mobile header */} +
+ + Showy +
+ + {/* Mobile sidebar sheet */} + + + + Navigation + + setMobileOpen(false)} /> + + + +
+
diff --git a/react_frontend/src/components/layout/Sidebar.tsx b/react_frontend/src/components/layout/Sidebar.tsx index 477e5dc..da7160a 100644 --- a/react_frontend/src/components/layout/Sidebar.tsx +++ b/react_frontend/src/components/layout/Sidebar.tsx @@ -75,7 +75,7 @@ export function Sidebar() { const { theme, toggleTheme } = useThemeStore(); return ( -