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.

69 lines
3.4 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. featured_users: { id: 'navigation_bar.featured_users', defaultMessage: 'Featured users' },
  24. });
  25. @connect()
  26. @injectIntl
  27. export default class gettingStartedMisc extends ImmutablePureComponent {
  28. static propTypes = {
  29. intl: PropTypes.object.isRequired,
  30. dispatch: PropTypes.func.isRequired,
  31. };
  32. openOnboardingModal = (e) => {
  33. this.props.dispatch(openModal('ONBOARDING'));
  34. }
  35. openFeaturedAccountsModal = (e) => {
  36. this.props.dispatch(openModal('PINNED_ACCOUNTS_EDITOR'));
  37. }
  38. render () {
  39. const { intl } = this.props;
  40. let i = 1;
  41. return (
  42. <Column icon='ellipsis-h' heading={intl.formatMessage(messages.heading)}>
  43. <ColumnBackButtonSlim />
  44. <div className='scrollable'>
  45. <ColumnSubheading text={intl.formatMessage(messages.subheading)} />
  46. <ColumnLink key='{i++}' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />
  47. <ColumnLink key='{i++}' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />
  48. <ColumnLink key='{i++}' icon='users' text={intl.formatMessage(messages.featured_users)} onClick={this.openFeaturedAccountsModal} />
  49. <ColumnLink key='{i++}' icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />
  50. <ColumnLink key='{i++}' icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />
  51. <ColumnLink key='{i++}' icon='minus-circle' text={intl.formatMessage(messages.domain_blocks)} to='/domain_blocks' />
  52. <ColumnLink key='{i++}' icon='question' text={intl.formatMessage(messages.keyboard_shortcuts)} to='/keyboard-shortcuts' />
  53. <ColumnLink key='{i++}' icon='book' text={intl.formatMessage(messages.info)} href='/about/more' />
  54. <ColumnLink key='{i++}' icon='hand-o-right' text={intl.formatMessage(messages.show_me_around)} onClick={this.openOnboardingModal} />
  55. </div>
  56. </Column>
  57. );
  58. }
  59. }