expose syntax in detailsExpander

ref #429
This commit is contained in:
Collin Barrett 2018-09-15 20:58:23 -05:00
parent 9220647820
commit f6ce391eca
3 changed files with 18 additions and 2 deletions

View file

@ -16,7 +16,7 @@
publishedDate: string;
ruleCount: number;
submissionUrl: string;
syntax: IListSyntaxDto[];
syntax: IListSyntaxDto;
tags: IListTagDto[];
updatedDate: string;
viewUrl: string;

View file

@ -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) => {
<DiscontinuedDate date={props.discontinuedDate}/>
<UpdatedDate {...props}/>
<PublishedDate date={props.publishedDate}/>
<Syntax {...props.syntax}/>
<License {...props.license}/>
</ul>
</div>;

View file

@ -0,0 +1,14 @@
import * as React from "react";
import { IListSyntaxDto } from "../IFilterListDetailsDto";
export const Syntax = (props: IListSyntaxDto) => {
return props.name
? (props.definitionUrl
? <li className="list-group-item">
<p>Syntax: <a href={props.definitionUrl}>{props.name}</a></p>
</li>
: <li className="list-group-item">
<p>Syntax: {props.name}</p>
</li>)
: null;
};