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 1.0KB

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