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
3.0 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. domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },
  17. mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
  18. info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' },
  19. show_me_around: { id: 'getting_started.onboarding', defaultMessage: 'Show me around' },
  20. pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },
  21. info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' },
  22. keyboard_shortcuts: { id: 'navigation_bar.keyboard_shortcuts', defaultMessage: 'Keyboard shortcuts' },
  23. });
  24. @connect()
  25. @injectIntl
  26. export default class gettingStartedMisc extends ImmutablePureComponent {
  27. static propTypes = {
  28. intl: PropTypes.object.isRequired,
  29. dispatch: PropTypes.func.isRequired,
  30. };
  31. openOnboardingModal = (e) => {
  32. e.preventDefault();
  33. this.props.dispatch(openModal('ONBOARDING'));
  34. }
  35. render () {
  36. const { intl } = this.props;
  37. return (
  38. <Column icon='ellipsis-h' heading={intl.formatMessage(messages.heading)}>
  39. <ColumnBackButtonSlim />
  40. <div className='scrollable'>
  41. <ColumnSubheading text={intl.formatMessage(messages.subheading)} />
  42. <ColumnLink key='19' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />
  43. <ColumnLink key='20' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />
  44. <ColumnLink key='21' icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />
  45. <ColumnLink key='22' icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />
  46. <ColumnLink icon='ban' text={intl.formatMessage(messages.domain_blocks)} to='/domain_blocks' />
  47. <ColumnLink key='23' icon='question' text={intl.formatMessage(messages.keyboard_shortcuts)} to='/keyboard-shortcuts' />
  48. <ColumnLink icon='book' text={intl.formatMessage(messages.info)} href='/about/more' />
  49. <ColumnLink icon='hand-o-right' text={intl.formatMessage(messages.show_me_around)} onClick={this.openOnboardingModal} />
  50. </div>
  51. </Column>
  52. );
  53. }
  54. }