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.

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