Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

OpenCarmodeButton.tsx 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* eslint-disable lines-around-comment */
  2. import { IReduxState } from '../../../app/types';
  3. import { CAR_MODE_ENABLED } from '../../../base/flags/constants';
  4. import { getFeatureFlag } from '../../../base/flags/functions';
  5. import { translate } from '../../../base/i18n/functions';
  6. import { IconCar } from '../../../base/icons/svg';
  7. import { connect } from '../../../base/redux/functions';
  8. // @ts-ignore
  9. import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
  10. import { navigate }
  11. // @ts-ignore
  12. from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
  13. // @ts-ignore
  14. import { screen } from '../../../mobile/navigation/routes';
  15. /**
  16. * Implements an {@link AbstractButton} to open the carmode.
  17. */
  18. class OpenCarmodeButton extends AbstractButton<AbstractButtonProps, any, any> {
  19. accessibilityLabel = 'toolbar.accessibilityLabel.carmode';
  20. icon = IconCar;
  21. label = 'carmode.labels.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.conference.carmode);
  30. }
  31. }
  32. /**
  33. * Maps part of the Redux state to the props of this component.
  34. *
  35. * @param {IReduxState} state - The Redux state.
  36. * @param {AbstractButtonProps} ownProps - The properties explicitly passed to the component instance.
  37. * @private
  38. * @returns {Object}
  39. */
  40. function _mapStateToProps(state: IReduxState, ownProps: AbstractButtonProps): Object {
  41. const enabled = getFeatureFlag(state, CAR_MODE_ENABLED, true);
  42. const { visible = enabled } = ownProps;
  43. return {
  44. visible
  45. };
  46. }
  47. // @ts-ignore
  48. export default translate(connect(_mapStateToProps)(OpenCarmodeButton));