diff --git a/app/src/component/fileList/view.js b/app/src/component/fileList/view.js index 4416f7b0..f7d52cd9 100644 --- a/app/src/component/fileList/view.js +++ b/app/src/component/fileList/view.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { buildURI } from 'lbry-redux'; import { FlatList } from 'react-native'; -import FileItem from '../fileItem'; -import discoverStyle from '../../styles/discover'; +import FileItem from 'component/fileItem'; +import discoverStyle from 'styles/discover'; // In the future, all Flow types need to be specified in a common source (lbry-redux, perhaps?) type FileInfo = { @@ -145,7 +145,15 @@ class FileList extends React.PureComponent { sortFunctions: {}; render() { - const { fileInfos, hideFilter, checkPending, navigation, style } = this.props; + const { + contentContainerStyle, + fileInfos, + hideFilter, + checkPending, + navigation, + onEndReached, + style + } = this.props; const { sortBy } = this.state; const items = []; @@ -170,7 +178,9 @@ class FileList extends React.PureComponent { return ( item} renderItem={({item}) => ( { const { uri, fetchClaims } = this.props; if (this.state.page > 1) { - this.setState({ page: this.state.page - 1 }, () => { + this.setState({ page: this.state.page - 1, showPageButtons: false }, () => { fetchClaims(uri, this.state.page); }); } @@ -35,7 +36,7 @@ class ChannelPage extends React.PureComponent { handleNextPage = () => { const { uri, fetchClaims, totalPages } = this.props; if (this.state.page < totalPages) { - this.setState({ page: this.state.page + 1 }, () => { + this.setState({ page: this.state.page + 1, showPageButtons: false }, () => { fetchClaims(uri, this.state.page); }); } @@ -69,7 +70,9 @@ class ChannelPage extends React.PureComponent { hideFilter fileInfos={claimsInChannel} navigation={navigation} - style={channelPageStyle.fileList} /> + style={channelPageStyle.fileList} + contentContainerStyle={channelPageStyle.fileListContent} + onEndReached={() => this.setState({ showPageButtons: true })} /> ) : ( No content found. @@ -81,7 +84,7 @@ class ChannelPage extends React.PureComponent { navigateBack(navigation, drawerStack, popDrawerStack)} /> {contentList} - {(totalPages > 1) && + {(totalPages > 1) && this.state.showPageButtons && {(this.state.page > 1) &&