From 79ee4dad616113a8be6c9d14389f16a8231352a5 Mon Sep 17 00:00:00 2001 From: Brandon Egger Date: Thu, 16 Mar 2023 18:00:04 -0500 Subject: [PATCH] update resource table to support new download links --- src/components/ResourceTable.tsx | 12 ++++++------ src/pages/resources/[id].tsx | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 src/pages/resources/[id].tsx diff --git a/src/components/ResourceTable.tsx b/src/components/ResourceTable.tsx index e420cb0..d65f04f 100644 --- a/src/components/ResourceTable.tsx +++ b/src/components/ResourceTable.tsx @@ -1,4 +1,4 @@ -import { type Platform, type PaymentType, type AuditoryResource, type Skill, type SkillLevel } from '@prisma/client'; +import { type PlatformLink, type PaymentType, type AuditoryResource, type Skill, type SkillLevel } from '@prisma/client'; import { CurrencyDollarIcon, ArrowPathRoundedSquareIcon } from '@heroicons/react/24/solid'; import { ClipboardDocumentListIcon } from '@heroicons/react/24/outline'; import Image from 'next/image'; @@ -17,9 +17,9 @@ const ResourceEntry = ({resource}: {resource: AuditoryResource}) => { ) } - const PlatformInfo = ({platforms}: {platforms: Platform[]}) => { - const platformsStr = platforms.map((platform) => { - return translateEnumPlatform(platform); + const PlatformInfo = ({platformLinks}: {platformLinks: PlatformLink[]}) => { + const platformsStr = platformLinks.map((platformLink) => { + return translateEnumPlatform(platformLink.platform); }).join(', '); return ( @@ -32,7 +32,7 @@ const ResourceEntry = ({resource}: {resource: AuditoryResource}) => {
- Word Success logo + {`${resource.name} more info @@ -44,7 +44,7 @@ const ResourceEntry = ({resource}: {resource: AuditoryResource}) => {

{resource.manufacturer}

{resource.name}

- +
diff --git a/src/pages/resources/[id].tsx b/src/pages/resources/[id].tsx new file mode 100644 index 0000000..9e0b814 --- /dev/null +++ b/src/pages/resources/[id].tsx @@ -0,0 +1,17 @@ +// GOOD TUTORIAL + +export default function Resource() { + return ( + <> + Hello + + ); + } + +export async function getStaticPaths() { + // Return a list of possible value for id +} + +export async function getStaticProps({ params }) { + // Fetch necessary data for the blog post using params.id +}