mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add License to list details in UI
This commit is contained in:
parent
d08f13758f
commit
e1e56803ba
1 changed files with 17 additions and 2 deletions
|
|
@ -38,6 +38,7 @@ function FilterListDetails(props: any) {
|
|||
<Languages languages={props.details.languages}/>
|
||||
<PublishedDate date={props.details.publishedDate}/>
|
||||
<DiscontinuedDate date={props.details.discontinuedDate}/>
|
||||
<License license={props.details.license}/>
|
||||
<div className="btn-group" role="group">
|
||||
<SubscribeUrl url={props.details.viewUrl} name={props.details.name}/>
|
||||
<ViewUrl url={props.details.viewUrl} name={props.details.name}/>
|
||||
|
|
@ -66,14 +67,14 @@ function Languages(props: any) {
|
|||
return props.languages.length > 0
|
||||
? props.languages.length > 1
|
||||
? <div>
|
||||
<h3>Languages:</h3>
|
||||
<p>Languages:</p>
|
||||
<ul>
|
||||
{props.languages.map(
|
||||
(language: any) => <li>{language}</li>)}
|
||||
</ul>
|
||||
</div>
|
||||
: <div>
|
||||
<h3>Language:</h3>
|
||||
<p>Language:</p>
|
||||
<ul>
|
||||
{props.languages.map(
|
||||
(language: any) => <li>{language}</li>)}
|
||||
|
|
@ -90,6 +91,14 @@ function DiscontinuedDate(props: any) {
|
|||
return props.date ? <p>Discontinued: {props.date}</p> : null;
|
||||
}
|
||||
|
||||
function License(props: any) {
|
||||
return props.license
|
||||
? (props.license.descriptionUrl
|
||||
? <p>License: <a href={props.license.descriptionUrl}>{props.license.name}</a></p>
|
||||
: <p>License: {props.license.name}</p>)
|
||||
: null;
|
||||
}
|
||||
|
||||
function SubscribeUrl(props: any) {
|
||||
return <a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&title=${encodeURIComponent(props.name)}`}
|
||||
className="visible-xs btn btn-primary btn-expander-link"
|
||||
|
|
@ -242,6 +251,7 @@ interface IFilterListDetailsDto {
|
|||
homeUrl: string;
|
||||
issuesUrl: string;
|
||||
languages: string[];
|
||||
license: IListLicenseDto;
|
||||
maintainers: IListMaintainerDto[];
|
||||
policyUrl: string;
|
||||
publishedDate: string;
|
||||
|
|
@ -249,6 +259,11 @@ interface IFilterListDetailsDto {
|
|||
viewUrl: string;
|
||||
}
|
||||
|
||||
interface IListLicenseDto {
|
||||
descriptionUrl: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface IListMaintainerDto {
|
||||
id: number;
|
||||
emailAddress: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue