onScrollToBottom: PropTypes.func,
onScrollToTop: PropTypes.func,
onScroll: PropTypes.func,
+ trackScroll: PropTypes.bool,
shouldUpdateScroll: PropTypes.func,
isLoading: PropTypes.bool,
isUnread: PropTypes.bool,
}
render () {
- const { statusIds, onScrollToBottom, scrollKey, shouldUpdateScroll, isLoading, isUnread, hasMore, prepend, emptyMessage } = this.props;
+ const { statusIds, onScrollToBottom, scrollKey, trackScroll, shouldUpdateScroll, isLoading, isUnread, hasMore, prepend, emptyMessage } = this.props;
let loadMore = null;
let scrollableArea = null;
);
}
- return (
- <ScrollContainer scrollKey={scrollKey} shouldUpdateScroll={shouldUpdateScroll}>
- {scrollableArea}
- </ScrollContainer>
- );
+ if (trackScroll) {
+ return (
+ <ScrollContainer scrollKey={scrollKey} shouldUpdateScroll={shouldUpdateScroll}>
+ {scrollableArea}
+ </ScrollContainer>
+ );
+ } else {
+ return scrollableArea;
+ }
}
}
let loadMore = '';
let scrollableArea = '';
let unread = '';
+ let scrollContainer = '';
if (!isLoading && notifications.size > 0) {
loadMore = <LoadMore onClick={this.handleLoadMore} />;
);
}
+ if (pinned) {
+ scrollContainer = scrollableArea;
+ } else {
+ scrollContainer = (
+ <ScrollContainer scrollKey={`notifications-${columnId}`} shouldUpdateScroll={shouldUpdateScroll}>
+ {scrollableArea}
+ </ScrollContainer>
+ );
+ }
+
this.scrollableArea = scrollableArea;
return (
<ColumnSettingsContainer />
</ColumnHeader>
- <ScrollContainer scrollKey={`notifications-${columnId}`} shouldUpdateScroll={shouldUpdateScroll}>
- {scrollableArea}
- </ScrollContainer>
+ {scrollContainer}
</Column>
);
}