From c7d9eb8ec03eacc61e2476ceb3922c660b00259d Mon Sep 17 00:00:00 2001 From: zxj96 <519213124@qq.com> Date: Wed, 24 Apr 2019 13:52:09 +0800 Subject: [PATCH] Display quantity up --- .../pages/lib-content-view/lib-content-container.js | 11 +++-------- .../src/pages/lib-content-view/lib-content-view.js | 6 +++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/src/pages/lib-content-view/lib-content-container.js b/frontend/src/pages/lib-content-view/lib-content-container.js index 87ce25e440..904566b996 100644 --- a/frontend/src/pages/lib-content-view/lib-content-container.js +++ b/frontend/src/pages/lib-content-view/lib-content-container.js @@ -86,7 +86,6 @@ const propTypes = { onDeleteRepoTag: PropTypes.func.isRequired, updateDetail: PropTypes.bool.isRequired, onPageScroll: PropTypes.func.isRequired, - itemShowLength: PropTypes.number.isRequired }; class LibContentContainer extends React.Component { @@ -156,10 +155,6 @@ class LibContentContainer extends React.Component { } } - let direntItemsList = direntList.filter((item, index) => { - return index < this.props.itemShowLength; - }) - return (
@@ -195,7 +190,7 @@ class LibContentContainer extends React.Component { draftCounts={this.props.draftCounts} updateUsedRepoTags={this.props.updateUsedRepoTags} isDirentListLoading={this.props.isDirentListLoading} - direntList={direntItemsList} + direntList={this.props.direntList} showShareBtn={this.props.showShareBtn} sortBy={this.props.sortBy} sortOrder={this.props.sortOrder} @@ -234,7 +229,7 @@ class LibContentContainer extends React.Component { draftCounts={this.props.draftCounts} updateUsedRepoTags={this.props.updateUsedRepoTags} isDirentListLoading={this.props.isDirentListLoading} - direntList={direntItemsList} + direntList={this.props.direntList} onAddFile={this.props.onAddFile} onItemClick={this.onItemClick} onItemDelete={this.props.onItemDelete} @@ -286,7 +281,7 @@ class LibContentContainer extends React.Component { draftCounts={this.props.draftCounts} updateUsedRepoTags={this.props.updateUsedRepoTags} isDirentListLoading={this.props.isDirentListLoading} - direntList={direntItemsList} + direntList={this.props.direntList} showShareBtn={this.props.showShareBtn} sortBy={this.props.sortBy} sortOrder={this.props.sortOrder} diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js index f08a1cbac0..922eee3fbc 100644 --- a/frontend/src/pages/lib-content-view/lib-content-view.js +++ b/frontend/src/pages/lib-content-view/lib-content-view.js @@ -1346,6 +1346,10 @@ class LibContentView extends React.Component { } + let direntItemsList = this.state.direntList.filter((item, index) => { + return index < this.state.itemsShowLength; + }) + return (
@@ -1433,7 +1437,7 @@ class LibContentView extends React.Component { readmeMarkdown={this.state.readmeMarkdown} updateUsedRepoTags={this.updateUsedRepoTags} isDirentListLoading={this.state.isDirentListLoading} - direntList={this.state.direntList} + direntList={direntItemsList} showShareBtn={showShareBtn} sortBy={this.state.sortBy} sortOrder={this.state.sortOrder}