feat(ui): add favorites view and navigation

This commit is contained in:
Antigravity Agent committed 2026-02-04 22:31:40 +01:00
1 parent 031962d811
commit f391155da5
2 files changed
+21 -2

No files matched your search

+14
View File
@@ -125,6 +125,20 @@ export function Sidebar({ onSelectFeed, selectedFeedId }: SidebarProps) {
</span>
</button>
</div>
<div className="relative group/item mb-4">
<button
onClick={() => onSelectFeed('favorites')}
className={`w-full flex items-center justify-between px-4 py-2.5 rounded-lg transition-all duration-300 text-left ${selectedFeedId === 'favorites'
? 'bg-gold/10 text-gold-bright'
: 'text-paper-muted hover:text-gold hover:bg-gold/5'
}`}
>
<span className="text-sm font-medium truncate flex items-center">
<span className={`w-1.5 h-1.5 rounded-full bg-gold/40 mr-3 transition-opacity ${selectedFeedId === 'favorites' ? 'opacity-100' : 'opacity-0 group-hover/item:opacity-100'}`}></span>
Mes Favoris
</span>
</button>
</div>
{feeds?.map((feed) => (
<div key={feed.id} className="relative group/item">
<button
+7 -2
View File
@@ -20,7 +20,12 @@ export function DashboardPage({ selectedFeedId }: DashboardPageProps) {
const { data: articles, isLoading } = useQuery({
queryKey: ['articles', selectedFeedId],
queryFn: () => articlesApi.list({ feed_id: selectedFeedId || undefined }),
queryFn: () => {
if (selectedFeedId === 'favorites') {
return articlesApi.list({ favorite: true });
}
return articlesApi.list({ feed_id: selectedFeedId || undefined });
},
});
const refreshMutation = useMutation({
@@ -61,7 +66,7 @@ export function DashboardPage({ selectedFeedId }: DashboardPageProps) {
<div className="space-y-1">
<p className="text-gold text-[10px] uppercase tracking-[0.5em] font-black">Édition du jour</p>
<h1 className="text-6xl font-serif italic text-paper-white tracking-tighter">
{selectedFeedId ? 'Archives du Flux' : 'La Une'}
{selectedFeedId === 'favorites' ? 'Mes Favoris' : selectedFeedId ? 'Archives du Flux' : 'La Une'}
</h1>
</div>
<div className="flex flex-col items-center gap-4 text-center">