const mapStateToProps = (state, props) => ({
accountIds: state.getIn(['user_lists', 'followers', Number(props.params.accountId), 'items']),
+ hasMore: !!state.getIn(['user_lists', 'followers', Number(props.params.accountId), 'next']),
});
class Followers extends ImmutablePureComponent {
}
render () {
- const { accountIds } = this.props;
+ const { accountIds, hasMore } = this.props;
+
+ let loadMore = null;
if (!accountIds) {
return (
);
}
+ if (hasMore) {
+ loadMore = <LoadMore onClick={this.handleLoadMore} />;
+ }
+
return (
<Column>
<ColumnBackButton />
<div className='followers'>
<HeaderContainer accountId={this.props.params.accountId} />
{accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)}
- <LoadMore onClick={this.handleLoadMore} />
+ {loadMore}
</div>
</div>
</ScrollContainer>
const mapStateToProps = (state, props) => ({
accountIds: state.getIn(['user_lists', 'following', Number(props.params.accountId), 'items']),
+ hasMore: !!state.getIn(['user_lists', 'following', Number(props.params.accountId), 'next']),
});
class Following extends ImmutablePureComponent {
}
render () {
- const { accountIds } = this.props;
+ const { accountIds, hasMore } = this.props;
+
+ let loadMore = null;
if (!accountIds) {
return (
);
}
+ if (hasMore) {
+ loadMore = <LoadMore onClick={this.handleLoadMore} />;
+ }
+
return (
<Column>
<ColumnBackButton />
<div className='following'>
<HeaderContainer accountId={this.props.params.accountId} />
{accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)}
- <LoadMore onClick={this.handleLoadMore} />
+ {loadMore}
</div>
</div>
</ScrollContainer>