diff options
Diffstat (limited to 'app/assets/javascripts/components/features/community_timeline')
-rw-r--r-- | app/assets/javascripts/components/features/community_timeline/index.jsx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/app/assets/javascripts/components/features/community_timeline/index.jsx b/app/assets/javascripts/components/features/community_timeline/index.jsx index f7bc94d99..c2d8bf2ed 100644 --- a/app/assets/javascripts/components/features/community_timeline/index.jsx +++ b/app/assets/javascripts/components/features/community_timeline/index.jsx @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import PureRenderMixin from 'react-addons-pure-render-mixin'; +import PropTypes from 'prop-types'; import StatusListContainer from '../ui/containers/status_list_container'; import Column from '../ui/components/column'; import { @@ -25,17 +25,7 @@ const mapStateToProps = state => ({ let subscription; -const CommunityTimeline = React.createClass({ - - propTypes: { - dispatch: React.PropTypes.func.isRequired, - intl: React.PropTypes.object.isRequired, - streamingAPIBaseURL: React.PropTypes.string.isRequired, - accessToken: React.PropTypes.string.isRequired, - hasUnread: React.PropTypes.bool - }, - - mixins: [PureRenderMixin], +class CommunityTimeline extends React.PureComponent { componentDidMount () { const { dispatch, streamingAPIBaseURL, accessToken } = this.props; @@ -72,14 +62,14 @@ const CommunityTimeline = React.createClass({ } }); - }, + } componentWillUnmount () { // if (typeof subscription !== 'undefined') { // subscription.close(); // subscription = null; // } - }, + } render () { const { intl, hasUnread } = this.props; @@ -90,8 +80,16 @@ const CommunityTimeline = React.createClass({ <StatusListContainer type='community' emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />} /> </Column> ); - }, + } -}); +} + +CommunityTimeline.propTypes = { + dispatch: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + streamingAPIBaseURL: PropTypes.string.isRequired, + accessToken: PropTypes.string.isRequired, + hasUnread: PropTypes.bool +}; export default connect(mapStateToProps)(injectIntl(CommunityTimeline)); |