hasMore: PropTypes.bool,
prepend: PropTypes.node,
alwaysPrepend: PropTypes.bool,
- alwaysShowScrollbar: PropTypes.bool,
emptyMessage: PropTypes.node,
children: PropTypes.node,
};
}
render () {
- const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, prepend, alwaysPrepend, alwaysShowScrollbar, emptyMessage, onLoadMore } = this.props;
+ const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props;
const { fullscreen } = this.state;
const childrenCount = React.Children.count(children);
- const loadMore = (hasMore && childrenCount > 0 && onLoadMore) ? <LoadMore visible={!isLoading} onClick={this.handleLoadMore} /> : null;
+ const loadMore = (hasMore && onLoadMore) ? <LoadMore visible={!isLoading} onClick={this.handleLoadMore} /> : null;
let scrollableArea = null;
if (showLoading) {
</div>
</div>
);
- } else if (isLoading || childrenCount > 0 || !emptyMessage) {
+ } else if (isLoading || childrenCount > 0 || hasMore || !emptyMessage) {
scrollableArea = (
<div className={classNames('scrollable', { fullscreen })} ref={this.setRef} onMouseMove={this.handleMouseMove}>
<div role='feed' className='item-list'>
</div>
);
} else {
- const scrollable = alwaysShowScrollbar;
-
scrollableArea = (
- <div className={classNames({ scrollable, fullscreen })} ref={this.setRef} style={{ flex: '1 1 auto', display: 'flex', flexDirection: 'column' }}>
+ <div className={classNames('scrollable scrollable--flex', { fullscreen })} ref={this.setRef}>
{alwaysPrepend && prepend}
<div className='empty-column-indicator'>
return (
<LoadMore
disabled={this.props.disabled}
- onLoadMore={this.handleLoadMore}
+ onClick={this.handleLoadMore}
/>
);
}
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);
}
}
);
}
- if (!isLoading && medias.size > 0 && hasMore) {
- loadOlder = <LoadMore onClick={this.handleLoadOlder} />;
+ if (hasMore) {
+ loadOlder = <LoadMore visible={!isLoading} onClick={this.handleLoadOlder} />;
}
return (
<ColumnBackButton />
<ScrollContainer scrollKey='account_gallery' shouldUpdateScroll={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
))}
{loadOlder}
</div>
+
+ {isLoading && medias.size === 0 && (
+ <div className='scrollable__append'>
+ <LoadingIndicator />
+ </div>
+ )}
</div>
</ScrollContainer>
</Column>