mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add filter by name, other minor cleanup
This commit is contained in:
parent
f241bb8d18
commit
0c626b87c2
2 changed files with 9 additions and 14 deletions
|
|
@ -34,27 +34,24 @@ export class Home extends React.Component<RouteComponentProps<{}>, IFilterListsS
|
|||
return <ReactTable
|
||||
data={filterLists}
|
||||
columns={[
|
||||
{
|
||||
Header: "Id",
|
||||
accessor: "id",
|
||||
maxWidth: 50
|
||||
},
|
||||
{
|
||||
Header: "Name",
|
||||
accessor: "name"
|
||||
accessor: "name",
|
||||
filterable: true,
|
||||
filterMethod: (filter: any, row: any) => row[filter.id].toUpperCase().startsWith(filter.value.toUpperCase())
|
||||
},
|
||||
{
|
||||
Header: "Details",
|
||||
accessor: "id",
|
||||
Cell: (d: any) => <ListDetailsModal listId={d.value}/>,
|
||||
sortable: false,
|
||||
Cell: (rowInfo: any) => <ListDetailsModal listId={rowInfo.original.id}/>,
|
||||
style: { textAlign: "center" },
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
Header: "Subscribe",
|
||||
accessor: "viewUrl",
|
||||
Cell: (d: any) => <a
|
||||
href={`abp:subscribe?location=${encodeURIComponent(d.value)}&title=${encodeURIComponent(d.row.name)}`}
|
||||
sortable: false,
|
||||
Cell: (rowInfo: any) => <a
|
||||
href={`abp:subscribe?location=${encodeURIComponent(rowInfo.row.viewUrl)}&title=${encodeURIComponent(rowInfo.row.name)}`}
|
||||
className="btn btn-primary btn-block"
|
||||
title={"Subscribe to list with browser extension supporting \"abp:\" protcool (e.g. uBlock Origin, AdBlock Plus)."}>
|
||||
Subscribe</a>,
|
||||
|
|
|
|||
|
|
@ -68,9 +68,7 @@ function Name(props: any) {
|
|||
function Description(props: any) {
|
||||
if (props.description) {
|
||||
if (props.url) {
|
||||
return <p>
|
||||
<blockquote cite={props.url}>{props.description}</blockquote>
|
||||
</p>;
|
||||
return <blockquote cite={props.url}>{props.description}</blockquote>;
|
||||
} else {
|
||||
return <p>{props.description}</p>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue