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:
Mohammed Abad committed 2026-04-02 03:00:49 +01:00
1 parent ae67663623
commit d60d142d17
29 files changed
+1008 -226

No files matched your search

+13
View File
@@ -1,4 +1,5 @@
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { toast } from 'sonner';
import { entrySeenApi } from '@/api/entry-seen';
import { entryKeys } from './useEntries';
@@ -32,6 +33,10 @@ export function useCreateEntrySeen() {
queryKey: entryKeys.detail(variables.entry_id),
});
queryClient.invalidateQueries({ queryKey: entryKeys.all });
toast.success('Marked as watched');
},
onError: () => {
toast.error('Failed to mark as watched');
},
});
}
@@ -51,6 +56,10 @@ export function useUpdateEntrySeen() {
queryClient.invalidateQueries({
queryKey: entrySeenKeys.byEntry(variables.data.entry_id),
});
toast.success('Watch record updated');
},
onError: () => {
toast.error('Failed to update watch record');
},
});
}
@@ -66,6 +75,10 @@ export function useDeleteEntrySeen() {
queryKey: entrySeenKeys.byEntry(variables.entryId),
});
queryClient.invalidateQueries({ queryKey: entryKeys.all });
toast.success('Watch record removed');
},
onError: () => {
toast.error('Failed to remove watch record');
},
});
}