From e0a3deeb79bd5d64d338377e9b49aaaae3975daf Mon Sep 17 00:00:00 2001 From: hmhealey Date: Wed, 16 Dec 2015 09:39:26 -0500 Subject: Cleaned up floating post components --- web/react/components/posts_view.jsx | 89 ++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx index aedf431af..a28efbd04 100644 --- a/web/react/components/posts_view.jsx +++ b/web/react/components/posts_view.jsx @@ -444,46 +444,22 @@ export default class PostsView extends React.Component { } } - let floatingTimestamp = null; + let topPost = null; if (this.state.topPostId) { - const topPost = this.props.postList.posts[this.state.topPostId]; - const dateString = Utils.getDateForUnixTicks(topPost.create_at).toDateString(); - - let timestampClass = 'post-list__timestamp'; - if (this.state.isScrolling) { - timestampClass += ' scrolling'; - } - - floatingTimestamp = ( -
- {dateString} -
- ); - } - - let scrollToBottomArrows = null; - if ($(window).width() <= 768) { - let scrollToBottomArrowsClass = 'post-list__arrows'; - if (this.state.isScrolling && !this.wasAtBottom) { - scrollToBottomArrowsClass += ' scrolling'; - } - - scrollToBottomArrows = ( -
- ); + topPost = this.props.postList.posts[this.state.topPostId]; } return (
- {floatingTimestamp} - {scrollToBottomArrows} + +
768) { + return