add subscribe back to main grid on large screens

per cfecd906c1 (commitcomment-27637294)
This commit is contained in:
Collin M. Barrett 2018-02-18 14:27:59 -06:00
parent 5bd34feb76
commit 2268b4b4b2
2 changed files with 21 additions and 0 deletions

View file

@ -4,5 +4,6 @@ public class FilterListSummaryDto
{
public int Id { get; set; }
public string Name { get; set; }
public string ViewUrl { get; set; }
}
}

View file

@ -49,6 +49,16 @@ export class Home extends React.Component<RouteComponentProps<{}>, IFilterListsS
Cell: (row: any) => <ListDetailsModal listId={row.value} />,
style: { textAlign: "center" },
width: 100
},
{
Header: "Subscribe",
accessor: "viewUrl",
sortable: false,
Cell: (row: any) => <SubscribeUrl url={row.value} name={row.value.name} />,
style: { textAlign: "center" },
width: 100,
headerClassName: "hidden-xs",
className: "hidden-xs"
}
]}/>;
}
@ -57,4 +67,14 @@ export class Home extends React.Component<RouteComponentProps<{}>, IFilterListsS
interface IFilterListSummaryDto {
id: number;
name: string;
viewUrl: string;
}
//TODO: deduplicate function (maybe to a utils.js) also in ListDetailsModal.tsx
function SubscribeUrl(props: any) {
return <a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&amp;title=${encodeURIComponent(props.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>;
}