Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SettingsButton.tsx 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* eslint-disable lines-around-comment */
  2. import { connect } from 'react-redux';
  3. import { IReduxState } from '../../../../app/types';
  4. import { translate } from '../../../../base/i18n/functions';
  5. import { IconGear } from '../../../../base/icons/svg';
  6. // @ts-ignore
  7. import { AbstractButton, type AbstractButtonProps } from '../../../../base/toolbox/components';
  8. import { navigate }
  9. // @ts-ignore
  10. from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
  11. // @ts-ignore
  12. import { screen } from '../../../../mobile/navigation/routes';
  13. import { SETTINGS_ENABLED } from '../../../flags/constants';
  14. import { getFeatureFlag } from '../../../flags/functions';
  15. /**
  16. * Implements an {@link AbstractButton} to open the carmode.
  17. */
  18. class SettingsButton extends AbstractButton<AbstractButtonProps, any, any> {
  19. accessibilityLabel = 'toolbar.accessibilityLabel.Settings';
  20. icon = IconGear;
  21. label = 'settings.buttonLabel';
  22. /**
  23. * Handles clicking / pressing the button, and opens the carmode mode.
  24. *
  25. * @private
  26. * @returns {void}
  27. */
  28. _handleClick() {
  29. return navigate(screen.settings.main);
  30. }
  31. }
  32. /**
  33. * Maps part of the redux state to the component's props.
  34. *
  35. * @param {IReduxState} state - The Redux state.
  36. * @returns {Object}
  37. */
  38. function _mapStateToProps(state: IReduxState) {
  39. const enabled = getFeatureFlag(state, SETTINGS_ENABLED, true);
  40. return {
  41. visible: enabled
  42. };
  43. }
  44. // @ts-ignore
  45. export default translate(connect(_mapStateToProps)(SettingsButton));