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='static-content'>
  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.about_developer' defaultMessage='The developer of this project can be followed as Gargron@mastodon.social' /></p>
  43. </div>
  44. <div className='getting-started__illustration' />
  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));