From e78f985a120301f95238a3be89892bf8c6e27391 Mon Sep 17 00:00:00 2001 From: Brandon Egger Date: Wed, 29 Mar 2023 00:31:53 -0500 Subject: [PATCH] add additional hardware flag in resource and table view --- src/components/ResourceTable.tsx | 28 +++++++++++++++++++--------- src/pages/resources/[id].tsx | 8 +++----- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/components/ResourceTable.tsx b/src/components/ResourceTable.tsx index 79197ad..636ced6 100644 --- a/src/components/ResourceTable.tsx +++ b/src/components/ResourceTable.tsx @@ -1,4 +1,4 @@ -import { type PlatformLink, type PaymentType, type AuditoryResource, type Skill, type SkillLevel } from '@prisma/client'; +import { type PlatformLink, type PaymentType, type AuditoryResource, type Skill, type SkillLevel, Manufacturer } from '@prisma/client'; import { CurrencyDollarIcon, ArrowPathRoundedSquareIcon } from '@heroicons/react/24/solid'; import { ClipboardDocumentListIcon } from '@heroicons/react/24/outline'; import Image from 'next/image'; @@ -78,15 +78,25 @@ export const ResourceInfo = ({resource, showMoreInfo}: {resource: AuditoryResour ) } -const ResourceEntry = ({resource}: {resource: AuditoryResource}) => { - const ResourceDescription = ({description}: {description: string}) => { - return ( -
+export const ResourceDescription = ({manufacturer, description}: {manufacturer: null | Manufacturer, description: string}) => { + return ( +
+

{description}

- ) - } - + { manufacturer?.required ? +
+

IMPORTANT

+

+ This resource requires additional hardware from the manufacturer. +

+
+ : undefined} +
+ ) +} + +const ResourceEntry = ({resource}: {resource: AuditoryResource}) => { const ResourceSkills = ({skills, skillLevels}: {skills: Skill[], skillLevels: SkillLevel[]}) => { const SkillRanking = ({skillLevels}: {skillLevels: SkillLevel[]}) => { return ( @@ -148,7 +158,7 @@ const ResourceEntry = ({resource}: {resource: AuditoryResource}) => { - + ) diff --git a/src/pages/resources/[id].tsx b/src/pages/resources/[id].tsx index 5f9b1b3..fb3b71b 100644 --- a/src/pages/resources/[id].tsx +++ b/src/pages/resources/[id].tsx @@ -4,7 +4,7 @@ import { createProxySSGHelpers } from '@trpc/react-query/ssg'; import { appRouter } from "~/server/api/root"; import { prisma } from "~/server/db"; import { api } from "~/utils/api"; -import { ResourceInfo } from "~/components/ResourceTable"; +import { ResourceDescription, ResourceInfo } from "~/components/ResourceTable"; import { type PlatformLink } from "@prisma/client"; import Image from 'next/image'; import Link from "next/link"; @@ -125,10 +125,8 @@ const ResourceViewPage = (props: InferGetStaticPropsType)
-
-

- {resourceQuery.data.description} -

+
+
Ages {resourceQuery.data.ages.min}{resourceQuery.data.ages.max >= 100 ? "+" : `-${resourceQuery.data.ages.max}`}