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.

52 lines
2.5 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. sign_out: { id: 'navigation_bar.logout', defaultMessage: 'Sign out' }
  13. });
  14. const mapStateToProps = state => ({
  15. me: state.getIn(['accounts', state.getIn(['meta', 'me'])])
  16. });
  17. const GettingStarted = ({ intl, me }) => {
  18. let followRequests = '';
  19. if (me.get('locked')) {
  20. followRequests = <ColumnLink icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />;
  21. }
  22. return (
  23. <Column icon='asterisk' heading={intl.formatMessage(messages.heading)}>
  24. <div style={{ position: 'relative' }}>
  25. <ColumnLink icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' />
  26. <ColumnLink icon='cog' text={intl.formatMessage(messages.preferences)} href='/settings/preferences' />
  27. <ColumnLink icon='sign-out' text={intl.formatMessage(messages.sign_out)} href='/auth/sign_out' method='delete' />
  28. {followRequests}
  29. </div>
  30. <div className='scrollable optionally-scrollable'>
  31. <div className='static-content getting-started'>
  32. <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>
  33. <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>
  34. <p><FormattedMessage id='getting_started.about_developer' defaultMessage='The developer of this project can be followed as Gargron@mastodon.social' /></p>
  35. </div>
  36. </div>
  37. </Column>
  38. );
  39. };
  40. GettingStarted.propTypes = {
  41. intl: React.PropTypes.object.isRequired,
  42. me: ImmutablePropTypes.map.isRequired
  43. };
  44. export default connect(mapStateToProps)(injectIntl(GettingStarted));