|
@ -18,7 +18,6 @@ class StatusList extends ImmutablePureComponent { |
|
|
trackScroll: PropTypes.bool, |
|
|
trackScroll: PropTypes.bool, |
|
|
shouldUpdateScroll: PropTypes.func, |
|
|
shouldUpdateScroll: PropTypes.func, |
|
|
isLoading: PropTypes.bool, |
|
|
isLoading: PropTypes.bool, |
|
|
isUnread: PropTypes.bool, |
|
|
|
|
|
hasMore: PropTypes.bool, |
|
|
hasMore: PropTypes.bool, |
|
|
prepend: PropTypes.node, |
|
|
prepend: PropTypes.node, |
|
|
emptyMessage: PropTypes.node, |
|
|
emptyMessage: PropTypes.node, |
|
@ -89,25 +88,18 @@ class StatusList extends ImmutablePureComponent { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
render () { |
|
|
render () { |
|
|
const { statusIds, onScrollToBottom, scrollKey, trackScroll, shouldUpdateScroll, isLoading, isUnread, hasMore, prepend, emptyMessage } = this.props; |
|
|
|
|
|
|
|
|
const { statusIds, onScrollToBottom, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props; |
|
|
|
|
|
|
|
|
let loadMore = null; |
|
|
let loadMore = null; |
|
|
let scrollableArea = null; |
|
|
let scrollableArea = null; |
|
|
let unread = null; |
|
|
|
|
|
|
|
|
|
|
|
if (!isLoading && statusIds.size > 0 && hasMore) { |
|
|
if (!isLoading && statusIds.size > 0 && hasMore) { |
|
|
loadMore = <LoadMore onClick={this.handleLoadMore} />; |
|
|
loadMore = <LoadMore onClick={this.handleLoadMore} />; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isUnread) { |
|
|
|
|
|
unread = <div className='status-list__unread-indicator' />; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isLoading || statusIds.size > 0 || !emptyMessage) { |
|
|
if (isLoading || statusIds.size > 0 || !emptyMessage) { |
|
|
scrollableArea = ( |
|
|
scrollableArea = ( |
|
|
<div className='scrollable' ref={this.setRef}> |
|
|
<div className='scrollable' ref={this.setRef}> |
|
|
{unread} |
|
|
|
|
|
|
|
|
|
|
|
<div className='status-list'> |
|
|
<div className='status-list'> |
|
|
{prepend} |
|
|
{prepend} |
|
|
|
|
|
|
|
|