From 3253640f283d94f83a81ad1b3dfa4955528e87e5 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 26 Aug 2019 13:31:07 -0500 Subject: [PATCH] simple pagination, set title on drawer mount, ren details -> info --- ...stDetailsButton.tsx => ListInfoButton.tsx} | 8 +++---- ...stDetailsDrawer.tsx => ListInfoDrawer.tsx} | 12 +++++++++-- .../src/components/listsTable/ListsTable.tsx | 21 +++++++------------ 3 files changed, 22 insertions(+), 19 deletions(-) rename src/FilterLists.Web.V2/src/components/{ListDetailsButton.tsx => ListInfoButton.tsx} (69%) rename src/FilterLists.Web.V2/src/components/{ListDetailsDrawer.tsx => ListInfoDrawer.tsx} (94%) diff --git a/src/FilterLists.Web.V2/src/components/ListDetailsButton.tsx b/src/FilterLists.Web.V2/src/components/ListInfoButton.tsx similarity index 69% rename from src/FilterLists.Web.V2/src/components/ListDetailsButton.tsx rename to src/FilterLists.Web.V2/src/components/ListInfoButton.tsx index df308e8bd..efa70a457 100644 --- a/src/FilterLists.Web.V2/src/components/ListDetailsButton.tsx +++ b/src/FilterLists.Web.V2/src/components/ListInfoButton.tsx @@ -8,12 +8,12 @@ interface Props { list: List; }; -export const ListDetailsButton = (props: RouteComponentProps & Props) => +export const ListInfoButton = (props: RouteComponentProps & Props) => ; \ No newline at end of file + : props.history.push(`/lists/${props.list.id}`)} > + Info + ; \ No newline at end of file diff --git a/src/FilterLists.Web.V2/src/components/ListDetailsDrawer.tsx b/src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx similarity index 94% rename from src/FilterLists.Web.V2/src/components/ListDetailsDrawer.tsx rename to src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx index 9a8fb3d43..58d7788d8 100644 --- a/src/FilterLists.Web.V2/src/components/ListDetailsDrawer.tsx +++ b/src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx @@ -22,7 +22,7 @@ interface State { baseDocumentTitle: string; } -export class ListDetailsDrawer extends React.Component { +export class ListInfoDrawer extends React.Component { constructor(props: any) { super(props); this.state = { @@ -30,6 +30,10 @@ export class ListDetailsDrawer extends React.Component { languages: [], tags: [], pageSize: 0, - pageSizeOptions: [], isNarrowWindow: false }; this.updatePageSize = this.updatePageSize.bind(this); @@ -60,10 +58,8 @@ export class ListsTable extends React.Component { } private updatePageSize() { - const pageSize = Math.floor((window.innerHeight - 211.5) / 56); this.setState({ - pageSize: pageSize, - pageSizeOptions: [pageSize, 200, 2000].sort((a, b) => a - b).map(String), + pageSize: Math.floor((window.innerHeight - 211.5) / 56), isNarrowWindow: window.innerWidth < 576 ? true : false }); } @@ -78,18 +74,17 @@ export class ListsTable extends React.Component { size="small" pagination={{ size: "small", + simple: true, style: { float: "left" }, - pageSize: this.state.pageSize, - showSizeChanger: true, - pageSizeOptions: this.state.pageSizeOptions + pageSize: this.state.pageSize }} scroll={{ x: this.state.isNarrowWindow ? undefined : 1200 }}> - title="Details" + title="Info" dataIndex={nameof("viewUrl")} className={styles.nogrow} fixed="left" - render={(_text: string, record: List) => } /> + render={(_text: string, record: List) => } /> title="Name" dataIndex={nameof("name")} @@ -141,7 +136,7 @@ export class ListsTable extends React.Component { { const list = this.state.lists.find(l => l.id === +props.match.params.id); return list - ? + ? : this.state.lists && this.state.lists.length && }} />