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

58 lines
3.2 KiB

  1. import Column from '../ui/components/column';
  2. import ColumnLink from '../ui/components/column_link';
  3. import { Link } from 'react-router';
  4. import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
  5. import { connect } from 'react-redux';
  6. import ImmutablePropTypes from 'react-immutable-proptypes';
  7. const messages = defineMessages({
  8. heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
  9. public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Whole Known Network' },
  10. community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' },
  11. preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
  12. follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
  13. sign_out: { id: 'navigation_bar.logout', defaultMessage: 'Sign out' },
  14. favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },
  15. blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
  16. info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' }
  17. });
  18. const mapStateToProps = state => ({
  19. me: state.getIn(['accounts', state.getIn(['meta', 'me'])])
  20. });
  21. const GettingStarted = ({ intl, me }) => {
  22. let followRequests = '';
  23. if (me.get('locked')) {
  24. followRequests = <ColumnLink icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />;
  25. }
  26. return (
  27. <Column icon='asterisk' heading={intl.formatMessage(messages.heading)}>
  28. <div style={{ position: 'relative' }}>
  29. <ColumnLink icon='users' text={intl.formatMessage(messages.community_timeline)} to='/timelines/public/local' />
  30. <ColumnLink icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' />
  31. <ColumnLink icon='cog' text={intl.formatMessage(messages.preferences)} href='/settings/preferences' />
  32. <ColumnLink icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />
  33. {followRequests}
  34. <ColumnLink icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />
  35. <ColumnLink icon='book' text={intl.formatMessage(messages.info)} href='/about/more' />
  36. <ColumnLink icon='sign-out' text={intl.formatMessage(messages.sign_out)} href='/auth/sign_out' method='delete' />
  37. </div>
  38. <div className='scrollable optionally-scrollable' style={{ display: 'flex', flexDirection: 'column' }}>
  39. <div className='static-content getting-started'>
  40. <p><FormattedMessage id='getting_started.open_source_notice' defaultMessage='Mastodon is open source software. You can contribute or report issues on github at {github}. {apps}.' values={{ github: <a href="https://github.com/tootsuite/mastodon" target="_blank">tootsuite/mastodon</a>, apps: <a href="https://github.com/tootsuite/mastodon/blob/master/docs/Using-Mastodon/Apps.md" target="_blank"><FormattedMessage id='getting_started.apps' defaultMessage='Various apps are available' /></a> }} /></p>
  41. </div>
  42. </div>
  43. </Column>
  44. );
  45. };
  46. GettingStarted.propTypes = {
  47. intl: React.PropTypes.object.isRequired,
  48. me: ImmutablePropTypes.map.isRequired
  49. };
  50. export default connect(mapStateToProps)(injectIntl(GettingStarted));