From 393838e9ad4d15de4ba54547bcc06591a4e0ceab Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 12 Jul 2024 19:22:59 -0400 Subject: [PATCH] Update how channels are listed in Discover page --- src/components/DiscoverChannel.astro | 42 +++++++++++++++++++++++++ src/pages/discover/tech.astro | 47 +++++++--------------------- 2 files changed, 53 insertions(+), 36 deletions(-) create mode 100644 src/components/DiscoverChannel.astro diff --git a/src/components/DiscoverChannel.astro b/src/components/DiscoverChannel.astro new file mode 100644 index 0000000..8ce3b68 --- /dev/null +++ b/src/components/DiscoverChannel.astro @@ -0,0 +1,42 @@ +--- +// Properties +const { + ChannelId +} = Astro.props + +// Configuration +import { DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY} from '@utils/GetConfig' + +// Fetch +const channel = await fetch(DEFAULT_MEDIA_DATA_PROXY + "/api/v1/channels/" + ChannelId).then((response) => response.json()); +--- + + +
+ +

{channel.author}

+
+
+ \ No newline at end of file diff --git a/src/pages/discover/tech.astro b/src/pages/discover/tech.astro index fbf92ca..4d2cf9e 100644 --- a/src/pages/discover/tech.astro +++ b/src/pages/discover/tech.astro @@ -1,28 +1,26 @@ --- -import { changeLanguage } from "i18next"; +// Layout +import Base from "@layouts/Default.astro"; -import Discover from "@layouts/Discover.astro"; // Properties const { FetchData, CategoryName, CategoryDescription } = Astro.props; -// Use on top of Default Layout -import Base from "@layouts/Default.astro"; + +// Components +import DiscoverChannel from '@components/DiscoverChannel.astro' + // Configuration import { DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY } from '@utils/GetConfig' + // Discover Data -import Discover from "../../data/discover.json"; +import DiscoverData from "../../data/discover.json"; ---
- {Discover.Tech.map((channel) => - -
- -

{channel.Name}

-
-
+ {DiscoverData.Tech.map((channel) => + )}

@@ -32,27 +30,4 @@ import Discover from "../../data/discover.json"; - - \ No newline at end of file + \ No newline at end of file