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

62 lines
2.6 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. settings: { id: 'navigation_bar.settings', defaultMessage: 'Settings' },
  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 hamburgerStyle = {
  17. background: '#373b4a',
  18. color: '#fff',
  19. fontSize: '16px',
  20. padding: '15px',
  21. position: 'absolute',
  22. right: '0',
  23. top: '-48px',
  24. cursor: 'default'
  25. };
  26. const GettingStarted = ({ intl, me }) => {
  27. let followRequests = '';
  28. if (me.get('locked')) {
  29. followRequests = <ColumnLink icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />;
  30. }
  31. return (
  32. <Column icon='asterisk' heading={intl.formatMessage(messages.heading)}>
  33. <div style={{ position: 'relative' }}>
  34. <div style={hamburgerStyle}><i className='fa fa-bars' /></div>
  35. <ColumnLink icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' />
  36. <ColumnLink icon='cog' text={intl.formatMessage(messages.settings)} href='/settings/profile' />
  37. {followRequests}
  38. </div>
  39. <div className='scrollable optionally-scrollable'>
  40. <div className='static-content getting-started'>
  41. <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>
  42. <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>
  43. <p><FormattedMessage id='getting_started.about_developer' defaultMessage='The developer of this project can be followed as Gargron@mastodon.social' /></p>
  44. </div>
  45. </div>
  46. </Column>
  47. );
  48. };
  49. GettingStarted.propTypes = {
  50. intl: React.PropTypes.object.isRequired,
  51. me: ImmutablePropTypes.map.isRequired
  52. };
  53. export default connect(mapStateToProps)(injectIntl(GettingStarted));