diff options
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/web/app/dashboard/feeds/[feedId]/page.tsx | 31 | ||||
| -rw-r--r-- | apps/web/components/settings/FeedSettings.tsx | 13 |
2 files changed, 42 insertions, 2 deletions
diff --git a/apps/web/app/dashboard/feeds/[feedId]/page.tsx b/apps/web/app/dashboard/feeds/[feedId]/page.tsx new file mode 100644 index 00000000..ed5f9e40 --- /dev/null +++ b/apps/web/app/dashboard/feeds/[feedId]/page.tsx @@ -0,0 +1,31 @@ +import { notFound } from "next/navigation"; +import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks"; +import { api } from "@/server/api/client"; +import { TRPCError } from "@trpc/server"; + +export default async function FeedPage({ + params, +}: { + params: { feedId: string }; +}) { + let feed; + try { + feed = await api.feeds.get({ feedId: params.feedId }); + } catch (e) { + if (e instanceof TRPCError) { + if (e.code == "NOT_FOUND") { + notFound(); + } + } + throw e; + } + + return ( + <Bookmarks + query={{ rssFeedId: feed.id }} + showDivider={true} + showEditorCard={false} + header={<div className="text-2xl">{feed.name}</div>} + /> + ); +} diff --git a/apps/web/components/settings/FeedSettings.tsx b/apps/web/components/settings/FeedSettings.tsx index 9f2dbda9..09e6264c 100644 --- a/apps/web/components/settings/FeedSettings.tsx +++ b/apps/web/components/settings/FeedSettings.tsx @@ -1,6 +1,7 @@ "use client"; import React from "react"; +import Link from "next/link"; import { ActionButton } from "@/components/ui/action-button"; import { Form, @@ -14,6 +15,7 @@ import { FullPageSpinner } from "@/components/ui/full-page-spinner"; import { Input } from "@/components/ui/input"; import { toast } from "@/components/ui/use-toast"; import { api } from "@/lib/trpc"; +import { cn } from "@/lib/utils"; import { zodResolver } from "@hookform/resolvers/zod"; import { ArrowDownToLine, @@ -35,7 +37,7 @@ import { } from "@hoarder/shared/types/feeds"; import ActionConfirmingDialog from "../ui/action-confirming-dialog"; -import { Button } from "../ui/button"; +import { Button, buttonVariants } from "../ui/button"; import { Dialog, DialogClose, @@ -302,7 +304,14 @@ export function FeedRow({ feed }: { feed: ZFeed }) { return ( <TableRow> - <TableCell>{feed.name}</TableCell> + <TableCell> + <Link + href={`/dashboard/feeds/${feed.id}`} + className={cn(buttonVariants({ variant: "link" }))} + > + {feed.name} + </Link> + </TableCell> <TableCell>{feed.url}</TableCell> <TableCell>{feed.lastFetchedAt?.toLocaleString()}</TableCell> <TableCell> |
