From e8d2cf3f734797872fbddd189e0a997024343c29 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 3 Sep 2018 16:17:45 -0500 Subject: [PATCH] wip --- .../ClientApp/components/Home.tsx | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/FilterLists.Web/ClientApp/components/Home.tsx b/src/FilterLists.Web/ClientApp/components/Home.tsx index 4b5b58a21..4568530f9 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -11,6 +11,8 @@ interface IHomeState { loadingLists: boolean; ruleCount: number; loadingRuleCount: boolean; + software: ISoftwareDto[]; + loadingSoftware: boolean; pageSize: number; } @@ -22,13 +24,15 @@ export class Home extends React.Component, IHomeState> { loadingLists: true, ruleCount: 0, loadingRuleCount: true, + software: [], + loadingSoftware: true, pageSize: 20 }; this.updatePageSize = this.updatePageSize.bind(this); } render() { - const contents = this.state.loadingLists || this.state.loadingRuleCount + const contents = this.state.loadingLists || this.state.loadingRuleCount || this.state.loadingSoftware ?

Loading...

@@ -59,6 +63,14 @@ export class Home extends React.Component, IHomeState> { loadingRuleCount: false }); }); + fetch("https://filterlists.com/api/v1/software") + .then(response => response.json() as Promise) + .then(data => { + this.setState({ + software: data, + loadingSoftware: false + }); + }); } updatePageSize() { @@ -116,7 +128,8 @@ export class Home extends React.Component, IHomeState> { .includes(filter.value.toUpperCase()), sortMethod: (a: any, b: any) => a.join().toUpperCase() > b.join().toUpperCase() ? 1 : -1, Cell: (cell: any) =>
{cell.value.map( - (e: any) => {e.iso6391})}
, + (e: any) => {e.iso6391}) + }, style: { whiteSpace: "inherit" }, width: 60, headerClassName: "d-none d-md-block", @@ -140,9 +153,7 @@ export class Home extends React.Component, IHomeState> { onChange={event => onChange(event.target.value)} style={{ width: "100%" }} value={filter ? filter.value : "all"}> - - - + {state.software.map((e: any) => )} , Cell: (cell: any) =>
{cell.value.map( (e: any) => {e})}
,