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

50 lines
2.4 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: 'Public timeline' },
  10. preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
  11. follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }
  12. });
  13. const mapStateToProps = state => ({
  14. me: state.getIn(['accounts', state.getIn(['meta', 'me'])])
  15. });
  16. const GettingStarted = ({ intl, me }) => {
  17. let followRequests = '';
  18. if (me.get('locked')) {
  19. followRequests = <ColumnLink icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />;
  20. }
  21. return (
  22. <Column icon='asterisk' heading={intl.formatMessage(messages.heading)}>
  23. <div style={{ position: 'relative' }}>
  24. <ColumnLink icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' />
  25. <ColumnLink icon='cog' text={intl.formatMessage(messages.preferences)} href='/settings/preferences' />
  26. {followRequests}
  27. </div>
  28. <div className='scrollable optionally-scrollable'>
  29. <div className='static-content getting-started'>
  30. <p><FormattedMessage id='getting_started.about_addressing' defaultMessage='You can follow people if you know their username and the domain they are on by entering an e-mail-esque address into the form at the top of the sidebar.' /></p>
  31. <p><FormattedMessage id='getting_started.about_shortcuts' defaultMessage='If the target user is on the same domain as you, just the username will work. The same rule applies to mentioning people in statuses.' /></p>
  32. <p><FormattedMessage id='getting_started.about_developer' defaultMessage='The developer of this project can be followed as Gargron@mastodon.social' /></p>
  33. </div>
  34. </div>
  35. </Column>
  36. );
  37. };
  38. GettingStarted.propTypes = {
  39. intl: React.PropTypes.object.isRequired,
  40. me: ImmutablePropTypes.map.isRequired
  41. };
  42. export default connect(mapStateToProps)(injectIntl(GettingStarted));