diff options
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/components/FeedSidebar.tsx | 11 | ||||
| -rw-r--r-- | frontend/src/pages/ReadArticles.tsx | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/frontend/src/components/FeedSidebar.tsx b/frontend/src/components/FeedSidebar.tsx index 4d6502d..e196127 100644 --- a/frontend/src/components/FeedSidebar.tsx +++ b/frontend/src/components/FeedSidebar.tsx @@ -4,15 +4,20 @@ import { feedsAtom } from "../atoms"; interface Props { basePath: string; + isReadView?: boolean; } -export function FeedSidebar({ basePath }: Props) { +export function FeedSidebar({ basePath, isReadView = false }: Props) { const search = useSearch(); const [, setLocation] = useLocation(); const params = new URLSearchParams(search); const selectedFeedId = params.get("feed"); - const { data: feeds } = useAtomValue(feedsAtom); + const { data: allFeeds } = useAtomValue(feedsAtom); + + const feeds = isReadView + ? allFeeds + : allFeeds.filter((feed) => feed.unreadCount > 0); const handleSelect = (feedId: string | null) => { if (feedId) { @@ -53,7 +58,7 @@ export function FeedSidebar({ basePath }: Props) { }`} > <span className="min-w-0 truncate">{feed.title}</span> - {feed.unreadCount > 0 && ( + {!isReadView && feed.unreadCount > 0 && ( <span className="ml-2 shrink-0 rounded-full bg-sky-100 px-1.5 py-0.5 text-xs font-medium text-sky-700"> {feed.unreadCount} </span> diff --git a/frontend/src/pages/ReadArticles.tsx b/frontend/src/pages/ReadArticles.tsx index e231906..57fbc9a 100644 --- a/frontend/src/pages/ReadArticles.tsx +++ b/frontend/src/pages/ReadArticles.tsx @@ -28,7 +28,7 @@ export function ReadArticles() { <div className="flex gap-8"> <ErrorBoundary> <Suspense fallback={<LoadingSpinner />}> - <FeedSidebar basePath="/read" /> + <FeedSidebar basePath="/read" isReadView /> </Suspense> </ErrorBoundary> <div className="min-w-0 flex-1"> |
