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.

71 lines
2.1 KiB

  1. // Package imports
  2. import React from 'react';
  3. import PropTypes from 'prop-types';
  4. import { injectIntl, defineMessages } from 'react-intl';
  5. // Our imports
  6. import LocalSettingsNavigationItem from './item';
  7. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  8. const messages = defineMessages({
  9. general: { id: 'settings.general', defaultMessage: 'General' },
  10. collapsed: { id: 'settings.collapsed_statuses', defaultMessage: 'Collapsed toots' },
  11. media: { id: 'settings.media', defaultMessage: 'Media' },
  12. preferences: { id: 'settings.preferences', defaultMessage: 'Preferences' },
  13. close: { id: 'settings.close', defaultMessage: 'Close' },
  14. });
  15. @injectIntl
  16. export default class LocalSettingsNavigation extends React.PureComponent {
  17. static propTypes = {
  18. index : PropTypes.number,
  19. intl : PropTypes.object.isRequired,
  20. onClose : PropTypes.func.isRequired,
  21. onNavigate : PropTypes.func.isRequired,
  22. };
  23. render () {
  24. const { index, intl, onClose, onNavigate } = this.props;
  25. return (
  26. <nav className='glitch local-settings__navigation'>
  27. <LocalSettingsNavigationItem
  28. active={index === 0}
  29. index={0}
  30. onNavigate={onNavigate}
  31. title={intl.formatMessage(messages.general)}
  32. />
  33. <LocalSettingsNavigationItem
  34. active={index === 1}
  35. index={1}
  36. onNavigate={onNavigate}
  37. title={intl.formatMessage(messages.collapsed)}
  38. />
  39. <LocalSettingsNavigationItem
  40. active={index === 2}
  41. index={2}
  42. onNavigate={onNavigate}
  43. title={intl.formatMessage(messages.media)}
  44. />
  45. <LocalSettingsNavigationItem
  46. active={index === 3}
  47. href='/settings/preferences'
  48. index={3}
  49. icon='cog'
  50. title={intl.formatMessage(messages.preferences)}
  51. />
  52. <LocalSettingsNavigationItem
  53. active={index === 4}
  54. className='close'
  55. index={4}
  56. onNavigate={onClose}
  57. title={intl.formatMessage(messages.close)}
  58. />
  59. </nav>
  60. );
  61. }
  62. }