您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SettingsButton.tsx 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* eslint-disable lines-around-comment */
  2. import { IReduxState } from '../../../../app/types';
  3. import { translate } from '../../../../base/i18n/functions';
  4. import { IconGear } from '../../../../base/icons/svg';
  5. // @ts-ignore
  6. import { AbstractButton, type AbstractButtonProps } from '../../../../base/toolbox/components';
  7. import { navigate }
  8. // @ts-ignore
  9. from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
  10. // @ts-ignore
  11. import { screen } from '../../../../mobile/navigation/routes';
  12. import { SETTINGS_ENABLED } from '../../../flags/constants';
  13. import { getFeatureFlag } from '../../../flags/functions';
  14. import { connect } from '../../../redux/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));