闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. import { connect } from 'react-redux';
  2. import PureRenderMixin from 'react-addons-pure-render-mixin';
  3. import StatusListContainer from '../ui/containers/status_list_container';
  4. import Column from '../ui/components/column';
  5. import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
  6. import ColumnSettingsContainer from './containers/column_settings_container';
  7. import { Link } from 'react-router';
  8. const messages = defineMessages({
  9. title: { id: 'column.home', defaultMessage: 'Home' }
  10. });
  11. const mapStateToProps = state => ({
  12. hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0
  13. });
  14. const HomeTimeline = React.createClass({
  15. propTypes: {
  16. intl: React.PropTypes.object.isRequired,
  17. hasUnread: React.PropTypes.bool
  18. },
  19. mixins: [PureRenderMixin],
  20. render () {
  21. const { intl, hasUnread } = this.props;
  22. return (
  23. <Column icon='home' active={hasUnread} heading={intl.formatMessage(messages.title)}>
  24. <ColumnSettingsContainer />
  25. <StatusListContainer {...this.props} type='home' emptyMessage={<FormattedMessage id='empty_column.home' defaultMessage="You aren't following anyone yet. Visit {public} or use search to get started and meet other users." values={{ public: <Link to='/timelines/public'><FormattedMessage id='empty_column.home.public_timeline' defaultMessage='the public timeline' /></Link> }} />} />
  26. </Column>
  27. );
  28. },
  29. });
  30. export default connect(mapStateToProps)(injectIntl(HomeTimeline));