From 7e035f7446acb995186d261d0ebfbcd19d98ef61 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 26 Feb 2018 12:21:52 -0600 Subject: [PATCH] add basic maintainer info to details modal --- .../ClientApp/components/ListDetailsModal.tsx | 78 +++++++++++++++++-- 1 file changed, 70 insertions(+), 8 deletions(-) diff --git a/src/FilterLists.Web/ClientApp/components/ListDetailsModal.tsx b/src/FilterLists.Web/ClientApp/components/ListDetailsModal.tsx index 66ec54a7e..34d6b1e5f 100644 --- a/src/FilterLists.Web/ClientApp/components/ListDetailsModal.tsx +++ b/src/FilterLists.Web/ClientApp/components/ListDetailsModal.tsx @@ -39,9 +39,11 @@ export default class ListDetailsModal extends React.Component { render() { return
- + - +
; } @@ -50,8 +52,8 @@ export default class ListDetailsModal extends React.Component { function FilterListDetails(props: any) { return
- - + + @@ -63,6 +65,7 @@ function FilterListDetails(props: any) { +
; } @@ -81,8 +84,14 @@ function Description(props: any) { function Languages(props: any) { return props.languages.length > 0 ? props.languages.length > 1 - ?

Languages: {props.languages.join(", ")}

- :

Language: {props.languages.join(", ")}

+ ?
+

Languages

+

{props.languages.join(", ")}

+
+ :
+

Language

+

{props.languages.join(", ")}

+
: null; } @@ -118,7 +127,8 @@ function HomeUrl(props: any) { function PolicyUrl(props: any) { return props.url - ? + ? Policy : null; @@ -150,7 +160,8 @@ function ForumUrl(props: any) { function SubmissionUrl(props: any) { return props.url - ? + ? Submit New Rule : null; @@ -164,6 +175,42 @@ function EmailAddress(props: any) { : null; } +function Maintainers(props: any) { + return props.maintainers.length > 0 + ?
+

Maintainers

+ {props.maintainers.map( + (maintainer: any) => )} +
+ : null; +} + +function Maintainer(props: any) { + return
+

{props.maintainer.name}

+ {props.maintainer.homeUrl + ?

+ Home +

+ : null} + {props.maintainer.emailAddress + ?

+ Email +

+ : null} + {props.maintainer.twitterHandle + ?

+ Twitter +

+ : null} +
; +} + interface IFilterListDetailsDto { description: string; descriptionSourceUrl: string; @@ -174,9 +221,24 @@ interface IFilterListDetailsDto { homeUrl: string; issuesUrl: string; languages: string[]; + maintainers: IListMaintainerDto[]; name: string; policyUrl: string; publishedDate: string; submissionUrl: string; viewUrl: string; +} + +interface IListMaintainerDto { + id: number; + emailAddress: string; + homeUrl: string; + name: string; + twitterHandle: string; + additionalLists: IMaintainerAdditionalListsDto[]; +} + +interface IMaintainerAdditionalListsDto { + id: number; + name: string; } \ No newline at end of file