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

91 lines
4.8 KiB

  1. import React from 'react';
  2. import Column from '../ui/components/column';
  3. import ColumnLink from '../ui/components/column_link';
  4. import ColumnSubheading from '../ui/components/column_subheading';
  5. import Link from 'react-router/lib/Link';
  6. import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
  7. import { connect } from 'react-redux';
  8. import PropTypes from 'prop-types';
  9. import ImmutablePropTypes from 'react-immutable-proptypes';
  10. import ImmutablePureComponent from 'react-immutable-pure-component';
  11. const messages = defineMessages({
  12. heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
  13. public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' },
  14. navigation_subheading: { id: 'column_subheading.navigation', defaultMessage: 'Navigation'},
  15. settings_subheading: { id: 'column_subheading.settings', defaultMessage: 'Settings'},
  16. community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' },
  17. preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
  18. follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
  19. sign_out: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
  20. favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },
  21. blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
  22. mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
  23. info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' },
  24. });
  25. const mapStateToProps = state => ({
  26. me: state.getIn(['accounts', state.getIn(['meta', 'me'])]),
  27. });
  28. class GettingStarted extends ImmutablePureComponent {
  29. static propTypes = {
  30. intl: PropTypes.object.isRequired,
  31. me: ImmutablePropTypes.map.isRequired,
  32. };
  33. render () {
  34. const { intl, me } = this.props;
  35. let followRequests = '';
  36. if (me.get('locked')) {
  37. followRequests = <ColumnLink icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />;
  38. }
  39. return (
  40. <Column icon='asterisk' heading={intl.formatMessage(messages.heading)} hideHeadingOnMobile={true}>
  41. <div className='getting-started__wrapper'>
  42. <ColumnSubheading text={intl.formatMessage(messages.navigation_subheading)}/>
  43. <ColumnLink icon='users' hideOnMobile={true} text={intl.formatMessage(messages.community_timeline)} to='/timelines/public/local' />
  44. <ColumnLink icon='globe' hideOnMobile={true} text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' />
  45. <ColumnLink icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />
  46. {followRequests}
  47. <ColumnLink icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />
  48. <ColumnLink icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />
  49. <ColumnSubheading text={intl.formatMessage(messages.settings_subheading)}/>
  50. <ColumnLink icon='book' text={intl.formatMessage(messages.info)} href='/about/more' />
  51. <ColumnLink icon='cog' text={intl.formatMessage(messages.preferences)} href='/settings/preferences' />
  52. <ColumnLink icon='sign-out' text={intl.formatMessage(messages.sign_out)} href='/auth/sign_out' method='delete' />
  53. </div>
  54. <div className='getting-started__footer scrollable optionally-scrollable'>
  55. <div className='static-content getting-started'>
  56. <p>
  57. <FormattedMessage
  58. id='getting_started.support'
  59. defaultMessage='{faq} • {userguide} • {apps}'
  60. values={{
  61. faq: <a href="https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/FAQ.md" rel="noopener" target="_blank"><FormattedMessage id='getting_started.faq' defaultMessage='FAQ' /></a>,
  62. userguide: <a href="https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/User-guide.md" rel="noopener" target="_blank"><FormattedMessage id='getting_started.userguide' defaultMessage='User Guide' /></a>,
  63. apps: <a href="https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/Apps.md" rel="noopener" target="_blank"><FormattedMessage id='getting_started.appsshort' defaultMessage='Apps' /></a>,
  64. }}
  65. />
  66. </p>
  67. <p>
  68. <FormattedMessage
  69. id='getting_started.open_source_notice'
  70. defaultMessage='Mastodon is open source software. You can contribute or report issues on GitHub at {github}.'
  71. values={{ github: <a href="https://github.com/tootsuite/mastodon" rel="noopener" target="_blank">tootsuite/mastodon</a> }}
  72. />
  73. </p>
  74. </div>
  75. </div>
  76. </Column>
  77. );
  78. }
  79. }
  80. export default connect(mapStateToProps)(injectIntl(GettingStarted));