mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-21 06:08:06 +02:00
Standardize Focus Mode Article View & Fix UI
This commit is contained in:
1 parent
87538901d2
commit
803b51193a
4 files changed
+100
-112
No files matched your search
@@ -39,10 +39,23 @@ export function FocusPage({ onExit }: FocusPageProps) {
|
||||
},
|
||||
});
|
||||
|
||||
// Mutation to toggle favorite
|
||||
const toggleFavoriteMutation = useMutation({
|
||||
mutationFn: (id: string) => articlesApi.toggleFavorite(id),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['articles'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['feeds'] });
|
||||
},
|
||||
});
|
||||
|
||||
const handleMarkRead = (id: string) => {
|
||||
markReadMutation.mutate(id);
|
||||
};
|
||||
|
||||
const handleToggleFavorite = (id: string) => {
|
||||
toggleFavoriteMutation.mutate(id);
|
||||
};
|
||||
|
||||
const handleKeep = (id: string) => {
|
||||
// Do nothing api-wise, just skip.
|
||||
console.log('Skipped:', id);
|
||||
@@ -96,6 +109,7 @@ export function FocusPage({ onExit }: FocusPageProps) {
|
||||
articles={deck}
|
||||
onMarkRead={handleMarkRead}
|
||||
onKeep={handleKeep}
|
||||
onToggleFavorite={handleToggleFavorite}
|
||||
onEmpty={() => setIsComplete(true)}
|
||||
/>
|
||||
</main>
|
||||
|
||||
Reference in new issue
Block a user