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.tsx 1016B

123456789101112131415161718192021222324252627282930313233343536
  1. import React from 'react';
  2. import { Platform } from 'react-native';
  3. import { connect } from 'react-redux';
  4. import { IReduxState } from '../../../app/types';
  5. import { isDesktopShareButtonDisabled } from '../../functions.native';
  6. import ScreenSharingAndroidButton from './ScreenSharingAndroidButton';
  7. import ScreenSharingIosButton from './ScreenSharingIosButton';
  8. const ScreenSharingButton = (props: any) => (
  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 {Object}
  25. */
  26. function _mapStateToProps(state: IReduxState) {
  27. return {
  28. _disabled: isDesktopShareButtonDisabled(state)
  29. };
  30. }
  31. export default connect(_mapStateToProps)(ScreenSharingButton);