diff options
Diffstat (limited to 'app/javascript/flavours/glitch/features/account_gallery')
-rw-r--r-- | app/javascript/flavours/glitch/features/account_gallery/index.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.js b/app/javascript/flavours/glitch/features/account_gallery/index.js index 53b906d16..3f61af0e8 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.js +++ b/app/javascript/flavours/glitch/features/account_gallery/index.js @@ -35,7 +35,7 @@ class LoadMoreMedia extends ImmutablePureComponent { return ( <LoadMore disabled={this.props.disabled} - onLoadMore={this.handleLoadMore} + onClick={this.handleLoadMore} /> ); } @@ -67,7 +67,7 @@ export default class AccountGallery extends ImmutablePureComponent { handleScrollToBottom = () => { if (this.props.hasMore) { - this.handleLoadMore(this.props.medias.last().getIn(['status', 'id'])); + this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined); } } @@ -107,8 +107,8 @@ export default class AccountGallery extends ImmutablePureComponent { ); } - if (!isLoading && medias.size > 0 && hasMore) { - loadOlder = <LoadMore onClick={this.handleLoadOlder} />; + if (hasMore) { + loadOlder = <LoadMore visible={!isLoading} onClick={this.handleLoadOlder} />; } return ( @@ -116,14 +116,15 @@ export default class AccountGallery extends ImmutablePureComponent { <ColumnBackButton /> <ScrollContainer scrollKey='account_gallery' shouldUpdateScroll={this.shouldUpdateScroll}> - <div className='scrollable' onScroll={this.handleScroll}> + <div className='scrollable scrollable--flex' onScroll={this.handleScroll}> <HeaderContainer accountId={this.props.params.accountId} /> - <div className='account-gallery__container'> + <div role='feed' className='account-gallery__container'> {medias.map((media, index) => media === null ? ( <LoadMoreMedia key={'more:' + medias.getIn(index + 1, 'id')} maxId={index > 0 ? medias.getIn(index - 1, 'id') : null} + onLoadMore={this.handleLoadMore} /> ) : ( <MediaItem @@ -133,6 +134,12 @@ export default class AccountGallery extends ImmutablePureComponent { ))} {loadOlder} </div> + + {isLoading && medias.size === 0 && ( + <div className='scrollable__append'> + <LoadingIndicator /> + </div> + )} </div> </ScrollContainer> </Column> |