HTML5 cite quoted Descriptions

This commit is contained in:
Collin M. Barrett 2019-08-07 12:28:09 -05:00
parent 85a1ea09a0
commit a44aa3a179
3 changed files with 16 additions and 3 deletions

View file

@ -1,6 +1,6 @@
import { Table } from 'antd';
import * as React from "react";
import { SubscribeButton } from '../../shared';
import { SubscribeButton, Description } from '../../shared';
import { nameof } from '../../utils';
import './AllListsTable.css';
import { List } from './List';
@ -69,7 +69,7 @@ export class AllListsTable extends React.Component<{}, State> {
<Table.Column<List>
title="Description"
dataIndex={nameof<List>("description")}
render={(text: string) => <div>{text}</div>} />
render={(text: string, record: List) => <Description desriptionSourceUrl={record.descriptionSourceUrl} desription={text} />} />
<Table.Column<List>
title="Software"
dataIndex={nameof<List>("syntaxId")}

View file

@ -0,0 +1,11 @@
import * as React from "react";
interface Props {
desription: string;
desriptionSourceUrl: string;
};
export const Description = (props: Props): JSX.Element | null =>
props.desriptionSourceUrl
? <blockquote cite={props.desriptionSourceUrl}>{props.desription}</blockquote>
: <p>{props.desription}</p>;

View file

@ -1,3 +1,5 @@
import { SubscribeButton } from './buttons';
import { Description } from './Description';
export { SubscribeButton }
export { SubscribeButton };
export { Description };