diff options
Diffstat (limited to 'webapp/components/post_view/components/scroll_to_bottom_arrows.jsx')
-rw-r--r-- | webapp/components/post_view/components/scroll_to_bottom_arrows.jsx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/webapp/components/post_view/components/scroll_to_bottom_arrows.jsx b/webapp/components/post_view/components/scroll_to_bottom_arrows.jsx index d8d55f4be..73f8e6527 100644 --- a/webapp/components/post_view/components/scroll_to_bottom_arrows.jsx +++ b/webapp/components/post_view/components/scroll_to_bottom_arrows.jsx @@ -5,33 +5,33 @@ import $ from 'jquery'; import Constants from 'utils/constants.jsx'; +import PropTypes from 'prop-types'; + import React from 'react'; -export default class ScrollToBottomArrows extends React.Component { - render() { - // only show on mobile - if ($(window).width() > 768) { - return <noscript/>; - } - - let className = 'post-list__arrows'; - if (this.props.isScrolling && !this.props.atBottom) { - className += ' scrolling'; - } - - return ( - <div - className={className} - onClick={this.props.onClick} - > - <span dangerouslySetInnerHTML={{__html: Constants.SCROLL_BOTTOM_ICON}}/> - </div> - ); +export default function ScrollToBottomArrows(props) { + // only show on mobile + if ($(window).width() > 768) { + return <noscript/>; + } + + let className = 'post-list__arrows'; + if (props.isScrolling && !props.atBottom) { + className += ' scrolling'; } + + return ( + <div + className={className} + onClick={props.onClick} + > + <span dangerouslySetInnerHTML={{__html: Constants.SCROLL_BOTTOM_ICON}}/> + </div> + ); } ScrollToBottomArrows.propTypes = { - isScrolling: React.PropTypes.bool.isRequired, - atBottom: React.PropTypes.bool.isRequired, - onClick: React.PropTypes.func.isRequired + isScrolling: PropTypes.bool.isRequired, + atBottom: PropTypes.bool.isRequired, + onClick: PropTypes.func.isRequired }; |