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.

ScreenSharingButton.js 972B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import React from 'react';
  3. import { Platform } from 'react-native';
  4. import { connect } from '../../../base/redux';
  5. import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
  6. import ScreenSharingIosButton from './ScreenSharingIosButton.js';
  7. const ScreenSharingButton = props => (
  8. <>
  9. {Platform.OS === 'android'
  10. && <ScreenSharingAndroidButton { ...props } />
  11. }
  12. {Platform.OS === 'ios'
  13. && <ScreenSharingIosButton { ...props } />
  14. }
  15. </>
  16. );
  17. /**
  18. * Maps (parts of) the redux state to the associated props for the
  19. * {@code ScreenSharingButton} component.
  20. *
  21. * @param {Object} state - The Redux state.
  22. * @private
  23. * @returns {{
  24. * _disabled: boolean,
  25. * }}
  26. */
  27. function _mapStateToProps(state): Object {
  28. const disabled = state['features/base/audio-only'].enabled;
  29. return {
  30. _disabled: disabled
  31. };
  32. }
  33. export default connect(_mapStateToProps)(ScreenSharingButton);