Files
jitsi-meet/react/features/toolbox/components/native/ScreenSharingButton.tsx
Saúl Ibarra Corretgé b0deb9ec0c fix(lint) make sure eslint also runs on TypeScript files (#11777)
Co-authored-by: robertpin <robert.pin9@gmail.com>
Co-authored-by: Gabriel Borlea <gabriel.borlea@8x8.com>
2022-07-11 15:30:37 +03:00

36 lines
976 B
TypeScript

import React from 'react';
import { Platform } from 'react-native';
import { connect } from '../../../base/redux';
import { isDesktopShareButtonDisabled } from '../../functions.native';
import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
import ScreenSharingIosButton from './ScreenSharingIosButton.js';
const ScreenSharingButton = props => (
<>
{Platform.OS === 'android'
&& <ScreenSharingAndroidButton { ...props } />
}
{Platform.OS === 'ios'
&& <ScreenSharingIosButton { ...props } />
}
</>
);
/**
* Maps (parts of) the redux state to the associated props for the
* {@code ScreenSharingButton} component.
*
* @param {Object} state - The Redux state.
* @private
* @returns {Object}
*/
function _mapStateToProps(state: object): object {
return {
_disabled: isDesktopShareButtonDisabled(state)
};
}
export default connect(_mapStateToProps)(ScreenSharingButton);