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