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.

60 lines
3.7 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.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>
  41. <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>
  42. <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>
  43. </div>
  44. </div>
  45. </Column>
  46. );
  47. };
  48. GettingStarted.propTypes = {
  49. intl: React.PropTypes.object.isRequired,
  50. me: ImmutablePropTypes.map.isRequired
  51. };
  52. export default connect(mapStateToProps)(injectIntl(GettingStarted));