mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
wip
This commit is contained in:
parent
ec9b12a0ef
commit
e0f9ada433
1 changed files with 30 additions and 0 deletions
|
|
@ -122,6 +122,35 @@ export class Home extends React.Component<RouteComponentProps<{}>, IHomeState> {
|
|||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block"
|
||||
},
|
||||
{
|
||||
Header: "Software",
|
||||
accessor: "software",
|
||||
filterable: true,
|
||||
filterMethod: (filter: any, row: any) => {
|
||||
if (filter.value === "all") {
|
||||
return true;
|
||||
}
|
||||
if (filter.value === "true") {
|
||||
return row[filter.id] >= 21;
|
||||
}
|
||||
return row[filter.id] < 21;
|
||||
},
|
||||
Filter: ({ filter, onChange }) =>
|
||||
<select
|
||||
onChange={event => onChange(event.target.value)}
|
||||
style={{ width: "100%" }}
|
||||
value={filter ? filter.value : "all"}>
|
||||
<option value="all">Show All</option>
|
||||
<option value="true">Can Drink</option>
|
||||
<option value="false">Can't Drink</option>
|
||||
</select>,
|
||||
Cell: (cell: any) => <div className="fl-tag-container">{cell.value.map(
|
||||
(e: any) => <span className="badge badge-info">{e}</span>)}</div>,
|
||||
style: { whiteSpace: "inherit" },
|
||||
width: 150,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block"
|
||||
},
|
||||
{
|
||||
Header: "Updated",
|
||||
accessor: "updatedDate",
|
||||
|
|
@ -172,6 +201,7 @@ interface IListDto {
|
|||
id: number;
|
||||
name: string;
|
||||
languages: IListLanguageDto[];
|
||||
software: string[];
|
||||
tags: IListTagDto[];
|
||||
updatedDate: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue