From f6ce391ecaeabb1e76a172960eade4c0a241b167 Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Sat, 15 Sep 2018 20:58:23 -0500 Subject: [PATCH] expose syntax in detailsExpander ref #429 --- .../detailsExpander/IFilterListDetailsDto.ts | 2 +- .../detailsExpander/infoCard/InfoCard.tsx | 4 +++- .../components/detailsExpander/infoCard/Syntax.tsx | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IFilterListDetailsDto.ts b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IFilterListDetailsDto.ts index af5b14685..e3afa5d43 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IFilterListDetailsDto.ts +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IFilterListDetailsDto.ts @@ -16,7 +16,7 @@ publishedDate: string; ruleCount: number; submissionUrl: string; - syntax: IListSyntaxDto[]; + syntax: IListSyntaxDto; tags: IListTagDto[]; updatedDate: string; viewUrl: string; diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx index 6ef2f4ccf..045b5a662 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx @@ -6,6 +6,7 @@ import { Languages } from "./Languages"; import { License } from "./License"; import { PublishedDate } from "./PublishedDate"; import { RuleCount } from "./RuleCount"; +import { Syntax } from "./Syntax"; import { Tags } from "./Tags"; import { UpdatedDate } from "./UpdatedDate"; @@ -18,7 +19,7 @@ interface IProps { name: string; publishedDate: string; ruleCount: number; - syntax: IListSyntaxDto[]; + syntax: IListSyntaxDto; tags: IListTagDto[]; updatedDate: string; } @@ -33,6 +34,7 @@ export const InfoCard = (props: IProps) => { + ; diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx new file mode 100644 index 000000000..5f92b6cbe --- /dev/null +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx @@ -0,0 +1,14 @@ +import * as React from "react"; +import { IListSyntaxDto } from "../IFilterListDetailsDto"; + +export const Syntax = (props: IListSyntaxDto) => { + return props.name + ? (props.definitionUrl + ?
  • +

    Syntax: {props.name}

    +
  • + :
  • +

    Syntax: {props.name}

    +
  • ) + : null; +}; \ No newline at end of file