闭社主体 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.

37 lines
1.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. import { connect } from 'react-redux';
  2. import PropTypes from 'prop-types';
  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. class HomeTimeline extends React.PureComponent {
  15. render () {
  16. const { intl, hasUnread } = this.props;
  17. return (
  18. <Column icon='home' active={hasUnread} heading={intl.formatMessage(messages.title)}>
  19. <ColumnSettingsContainer />
  20. <StatusListContainer {...this.props} scrollKey='home_timeline' 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> }} />} />
  21. </Column>
  22. );
  23. }
  24. }
  25. HomeTimeline.propTypes = {
  26. intl: PropTypes.object.isRequired,
  27. hasUnread: PropTypes.bool
  28. };
  29. export default connect(mapStateToProps)(injectIntl(HomeTimeline));