diff --git a/package.json b/package.json index 860e3e91..36f02570 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@storybook/addon-knobs": "5.2.1", "@storybook/addon-links": "5.2.1", "@storybook/react": "5.2.1", - "@testing-library/react": "9.1.4", + "@testing-library/react": "9.2.0", "autoprefixer": "9.6.1", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "10.0.3", @@ -132,15 +132,15 @@ "storybook-host": "5.1.0", "storybook-router": "^0.3.3", "style-loader": "1.0.0", - "truffle": "5.0.37", + "truffle": "5.0.38", "truffle-contract": "4.0.31", "truffle-solidity-loader": "0.1.32", "uglifyjs-webpack-plugin": "2.2.0", "url-loader": "^2.1.0", "webpack": "4.41.0", - "webpack-bundle-analyzer": "3.5.1", + "webpack-bundle-analyzer": "3.5.2", "webpack-cli": "3.3.9", "webpack-dev-server": "3.8.1", - "webpack-manifest-plugin": "2.1.1" + "webpack-manifest-plugin": "2.1.2" } } diff --git a/src/components/Table/index.jsx b/src/components/Table/index.jsx index 577277aa..258bc14c 100644 --- a/src/components/Table/index.jsx +++ b/src/components/Table/index.jsx @@ -21,6 +21,7 @@ type Props = { children: Function, size: number, defaultFixed: boolean, + defaultRowsPerPage: number, defaultOrder: 'desc' | 'asc', noBorder: boolean, disablePagination: boolean, @@ -31,7 +32,7 @@ type State = { order?: Order, orderBy?: string, orderProp: boolean, - rowsPerPage: number, + rowsPerPage?: number, fixed?: boolean, } @@ -83,7 +84,7 @@ class GnoTable extends React.Component, State> { orderBy: undefined, fixed: undefined, orderProp: false, - rowsPerPage: 5, + rowsPerPage: undefined, } } @@ -147,6 +148,7 @@ class GnoTable extends React.Component, State> { defaultOrderBy, defaultOrder, defaultFixed, + defaultRowsPerPage, noBorder, } = this.props const { @@ -154,6 +156,7 @@ class GnoTable extends React.Component, State> { } = this.state const orderByParam = orderBy || defaultOrderBy const orderParam = order || defaultOrder + const displayRows = rowsPerPage || defaultRowsPerPage const fixedParam = typeof fixed !== 'undefined' ? fixed : !!defaultFixed const paginationClasses = { @@ -165,10 +168,10 @@ class GnoTable extends React.Component, State> { let sortedData = stableSort(data, getSorting(orderParam, orderByParam, orderProp), fixedParam) if (!disablePagination) { - sortedData = sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) + sortedData = sortedData.slice(page * displayRows, page * displayRows + displayRows) } - const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage) + const emptyRows = displayRows - Math.min(displayRows, data.length - page * displayRows) const isEmpty = size === 0 return ( @@ -191,7 +194,7 @@ class GnoTable extends React.Component, State> { extends React.Component, State> { GnoTable.defaultProps = { defaultOrder: 'asc', disablePagination: false, + defaultRowsPerPage: 5, } export default withStyles(styles)(GnoTable) diff --git a/src/routes/safe/components/Balances/index.jsx b/src/routes/safe/components/Balances/index.jsx index ee382025..2f0a5a88 100644 --- a/src/routes/safe/components/Balances/index.jsx +++ b/src/routes/safe/components/Balances/index.jsx @@ -155,6 +155,7 @@ class Balances extends React.Component { =3.5 <5" @@ -20267,4 +20274,4 @@ yauzl@^2.4.2: integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= dependencies: buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" \ No newline at end of file + fd-slicer "~1.1.0"