From 00efc987793981a9a6250dfbdc51e8d14c15d2f2 Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Thu, 31 Jan 2019 12:13:34 -0700 Subject: [PATCH] Fix linting, update Readme --- README.md | 4 ++ src/index.js | 103 ++++++++++++++++++++++++------------------------- src/methods.js | 3 +- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 901c5e9..9531d18 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,10 @@ **React Table v7** is mostly planned and I (@tannerlinsley) am looking for Patreon support to make it a reality. It will require a decent time commitment on my part to not only implement it, but also help people migrate and maintain it. If you would like to contribute to my Patreon goal for v7, [visit my Patreon and help me out!](https://patreon.com/tannerlinsley). Gold +## Issues, Questions and Support + +Github issues are temporarily disabled until v7 is out. Most if not all issues that were or will be opened are likely to be resolved or uneccessary after v7 is released (mostly due to the headless approach of the new component). If you have an issue or a question, feel free to use the [React Table Spectrum Community/Forum](https://spectrum.chat/react-table)! + ## Table of Contents - [Installation](#installation) diff --git a/src/index.js b/src/index.js index 8ec2e9f..91b25b9 100644 --- a/src/index.js +++ b/src/index.js @@ -259,12 +259,8 @@ export default class ReactTable extends Methods(Lifecycle(Component)) { } const makeHeaderGroups = (row, i) => { - const theadGroupProps = _.splitProps( - getTheadGroupProps(finalState, undefined, row, this) - ) - const theadGroupTrProps = _.splitProps( - getTheadGroupTrProps(finalState, undefined, row, this) - ) + const theadGroupProps = _.splitProps(getTheadGroupProps(finalState, undefined, row, this)) + const theadGroupTrProps = _.splitProps(getTheadGroupTrProps(finalState, undefined, row, this)) return ( makePageRow(d, i, rowInfo.nestingPath))} - {SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, () => { - const newExpanded = _.clone(expanded) + {SubComponent && + !rowInfo.subRows && + isExpanded && + SubComponent(rowInfo, () => { + const newExpanded = _.clone(expanded) - _.set(newExpanded, cellInfo.nestingPath, false) - })} + _.set(newExpanded, rowInfo.nestingPath, false) + })} ) } @@ -800,7 +799,7 @@ export default class ReactTable extends Methods(Lifecycle(Component)) { ) } - const makePagination = (isTop) => { + const makePagination = isTop => { const paginationProps = _.splitProps( getPaginationProps(finalState, undefined, undefined, this) ) @@ -820,50 +819,48 @@ export default class ReactTable extends Methods(Lifecycle(Component)) { ) } - const makeTable = () => { - return ( -
( +
+ {showPagination && showPaginationTop ? ( +
{makePagination(true)}
+ ) : null} + - {showPagination && showPaginationTop ? ( -
{makePagination(true)}
- ) : null} - - {hasHeaderGroups ? headerGroups.map(makeHeaderGroups) : null} - {makeHeaders()} - {hasFilters ? makeFilters() : null} - - {pageRows.map((d, i) => makePageRow(d, i))} - {padRows.map(makePadRow)} - - {hasColumnFooter ? makeColumnFooters() : null} - - {showPagination && showPaginationBottom ? ( -
{makePagination(false)}
- ) : null} - {!pageRows.length && ( - {_.normalizeComponent(noDataText)} - )} - -
- ) - } + {pageRows.map((d, i) => makePageRow(d, i))} + {padRows.map(makePadRow)} + + {hasColumnFooter ? makeColumnFooters() : null} + + {showPagination && showPaginationBottom ? ( +
{makePagination(false)}
+ ) : null} + {!pageRows.length && ( + {_.normalizeComponent(noDataText)} + )} + +
+ ) // childProps are optionally passed to a function-as-a-child return children ? children(finalState, makeTable, this) : makeTable() diff --git a/src/methods.js b/src/methods.js index 96cd872..f6e75ef 100644 --- a/src/methods.js +++ b/src/methods.js @@ -313,7 +313,6 @@ export default Base => filtered, defaultFilterMethod, resolvedData, - visibleColumns, allDecoratedColumns, } = resolvedState @@ -342,7 +341,7 @@ export default Base => page: this.getStateOrProp('page'), pageSize: this.getStateOrProp('pageSize'), filter: this.getStateOrProp('filter'), - }; + } this.props.onFetchData(currentState, this) }