1 import React from 'react'; 2 import { Platform } from 'react-native'; 3 import { connect } from 'react-redux'; 4 5 import { IReduxState } from '../../../app/types'; 6 import { isDesktopShareButtonDisabled } from '../../functions.native'; 7 8 import ScreenSharingAndroidButton from './ScreenSharingAndroidButton'; 9 import ScreenSharingIosButton from './ScreenSharingIosButton'; 10 11 const ScreenSharingButton = (props: any) => ( 12 <> 13 {Platform.OS === 'android' 14 && <ScreenSharingAndroidButton { ...props } /> 15 } 16 {Platform.OS === 'ios' 17 && <ScreenSharingIosButton { ...props } /> 18 } 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 36 export default connect(_mapStateToProps)(ScreenSharingButton);