From 93bde35cbf425eb64880aed2aa8b0c86eacfd381 Mon Sep 17 00:00:00 2001 From: Jake Walker Date: Thu, 6 Feb 2025 18:02:48 +0000 Subject: [PATCH] add podcast landing page --- client/src/index.tsx | 4 ++ client/src/routes/admin/podcast.tsx | 2 +- client/src/routes/admin/podcasts.tsx | 2 +- client/src/routes/podcast.tsx | 85 ++++++++++++++++++++++++++++ client/tsconfig.app.json | 3 +- 5 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 client/src/routes/podcast.tsx diff --git a/client/src/index.tsx b/client/src/index.tsx index cf90e6e..4f06dcb 100644 --- a/client/src/index.tsx +++ b/client/src/index.tsx @@ -83,6 +83,10 @@ const routes = [ component: () => ( {lazy(() => import("./routes/admin/episode"))()} ), + }, + { + path: "/:podcastId", + component: lazy(() => import("./routes/podcast")), } ]; diff --git a/client/src/routes/admin/podcast.tsx b/client/src/routes/admin/podcast.tsx index d2291d6..b397898 100644 --- a/client/src/routes/admin/podcast.tsx +++ b/client/src/routes/admin/podcast.tsx @@ -89,7 +89,7 @@ export default function AdminPodcast() {
- +
diff --git a/client/src/routes/admin/podcasts.tsx b/client/src/routes/admin/podcasts.tsx index c4f2425..95c045d 100644 --- a/client/src/routes/admin/podcasts.tsx +++ b/client/src/routes/admin/podcasts.tsx @@ -57,7 +57,7 @@ export default function AdminPodcasts() {
- +
diff --git a/client/src/routes/podcast.tsx b/client/src/routes/podcast.tsx new file mode 100644 index 0000000..5afc28e --- /dev/null +++ b/client/src/routes/podcast.tsx @@ -0,0 +1,85 @@ +import { useParams } from "@solidjs/router"; +import { createQuery } from "@tanstack/solid-query"; +import { readPodcastOptions, readEpisodesOptions } from "../client/@tanstack/solid-query.gen"; +import { ErrorBoundary, For, Show, Suspense } from "solid-js"; +import Error from "../components/error"; +import Loading from "../components/loading"; +import { DownloadIcon, MusicIcon } from "lucide-solid"; +import { SERVER_URL } from "../constants"; + +export default function Podcast() { + const params = useParams(); + + const podcastQuery = createQuery(() => ({ + ...readPodcastOptions({ + path: { + podcast_id: params.podcastId, + } + }) + })); + const episodeQuery = createQuery(() => ({ + ...readEpisodesOptions({ + path: { + podcast_id: params.podcastId, + } + }) + })) + + return ( +
+ }> + }> +
+
+
+ +
+
+ +
+
+
+
+

{podcastQuery.data?.name}

+

{podcastQuery.data?.description}

+
+
+
+
+
+
+ + {(episode) => ( +
+
+

+ +

+
+
+
+

{episode.name}

+ +

{new Date(episode.publish_date!).toLocaleDateString()}

+
+
+ +
+ +

+
+
+
+
+ +
+
+ )} +
+
+
+
+
+
+ ) +} diff --git a/client/tsconfig.app.json b/client/tsconfig.app.json index 12f076e..d50c655 100644 --- a/client/tsconfig.app.json +++ b/client/tsconfig.app.json @@ -23,9 +23,8 @@ "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true, - "baseUrl": "./", "paths": { - "*": ["src/types/*"] + "*": ["./src/types/*"] } }, "include": ["src", "src/types"]