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
2.8 KiB

  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import Column from 'flavours/glitch/features/ui/components/column';
  4. import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim';
  5. import { defineMessages, injectIntl } from 'react-intl';
  6. import ImmutablePureComponent from 'react-immutable-pure-component';
  7. import ColumnLink from 'flavours/glitch/features/ui/components/column_link';
  8. import ColumnSubheading from 'flavours/glitch/features/ui/components/column_subheading';
  9. import { openModal } from 'flavours/glitch/actions/modal';
  10. import { connect } from 'react-redux';
  11. const messages = defineMessages({
  12. heading: { id: 'column.heading', defaultMessage: 'Misc' },
  13. subheading: { id: 'column.subheading', defaultMessage: 'Miscellaneous options' },
  14. favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },
  15. blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
  16. mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
  17. info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' },
  18. show_me_around: { id: 'getting_started.onboarding', defaultMessage: 'Show me around' },
  19. pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },
  20. info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' },
  21. keyboard_shortcuts: { id: 'navigation_bar.keyboard_shortcuts', defaultMessage: 'Keyboard shortcuts' },
  22. });
  23. @connect()
  24. @injectIntl
  25. export default class gettingStartedMisc extends ImmutablePureComponent {
  26. static propTypes = {
  27. intl: PropTypes.object.isRequired,
  28. dispatch: PropTypes.func.isRequired,
  29. };
  30. openOnboardingModal = (e) => {
  31. e.preventDefault();
  32. this.props.dispatch(openModal('ONBOARDING'));
  33. }
  34. render () {
  35. const { intl } = this.props;
  36. return (
  37. <Column icon='ellipsis-h' heading={intl.formatMessage(messages.heading)}>
  38. <ColumnBackButtonSlim />
  39. <div className='scrollable'>
  40. <ColumnSubheading text={intl.formatMessage(messages.subheading)} />
  41. <ColumnLink key='19' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />
  42. <ColumnLink key='20' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />
  43. <ColumnLink key='21' icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />
  44. <ColumnLink key='22' icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />
  45. <ColumnLink key='23' icon='question' text={intl.formatMessage(messages.keyboard_shortcuts)} to='/keyboard-shortcuts' />
  46. <ColumnLink icon='book' text={intl.formatMessage(messages.info)} href='/about/more' />
  47. <ColumnLink icon='hand-o-right' text={intl.formatMessage(messages.show_me_around)} onClick={this.openOnboardingModal} />
  48. </div>
  49. </Column>
  50. );
  51. }
  52. }