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

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* eslint-disable lines-around-comment */
  2. import React from 'react';
  3. import { Platform } from 'react-native';
  4. import { IReduxState } from '../../../app/types';
  5. import { connect } from '../../../base/redux/functions';
  6. // @ts-ignore
  7. import { isDesktopShareButtonDisabled } from '../../functions.native';
  8. // @ts-ignore
  9. import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
  10. // @ts-ignore
  11. import ScreenSharingIosButton from './ScreenSharingIosButton.js';
  12. const ScreenSharingButton = (props: any) => (
  13. <>
  14. {Platform.OS === 'android'
  15. && <ScreenSharingAndroidButton { ...props } />
  16. }
  17. {Platform.OS === 'ios'
  18. && <ScreenSharingIosButton { ...props } />
  19. }
  20. </>
  21. );
  22. /**
  23. * Maps (parts of) the redux state to the associated props for the
  24. * {@code ScreenSharingButton} component.
  25. *
  26. * @param {Object} state - The Redux state.
  27. * @private
  28. * @returns {Object}
  29. */
  30. function _mapStateToProps(state: IReduxState) {
  31. return {
  32. _disabled: isDesktopShareButtonDisabled(state)
  33. };
  34. }
  35. export default connect(_mapStateToProps)(ScreenSharingButton);