From 42782aa26d9f87d0d6a1967d8bc4caf5d7a5ea2d Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Mon, 14 Dec 2020 10:51:51 +0200 Subject: Update FormListing component to match with new forms interface --- src/components/FormListing.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/components/FormListing.tsx b/src/components/FormListing.tsx index 2493608..c53cf67 100644 --- a/src/components/FormListing.tsx +++ b/src/components/FormListing.tsx @@ -9,15 +9,15 @@ import Tag from "./Tag"; import colors from "../colors"; -import { AllFormsForm } from "../api/forms"; +import { Form, FormFeatures } from "../api/forms"; interface FormListingProps { - form: AllFormsForm + form: Form } function FormListing({ form }: FormListingProps) { const listingStyle = css` - background-color: ${form.open ? colors.success : colors.darkButNotBlack}; + background-color: ${form.features.includes(FormFeatures.Open) ? colors.success : colors.darkButNotBlack}; width: 60%; padding: 20px; margin-top: 20px; @@ -39,13 +39,13 @@ function FormListing({ form }: FormListingProps) { let closedTag; - if (!form.open) { + if (!form.features.includes(FormFeatures.Open)) { closedTag = }; return
-

{closedTag}{form.title}

+

{closedTag}{form.name}

{form.description}

-- cgit v1.2.3