2022-07-18 13:16:08 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2021-03-05 15:33:53 +00:00
|
|
|
import React from 'react';
|
2020-11-04 08:32:06 +00:00
|
|
|
import { Platform } from 'react-native';
|
|
|
|
|
2022-10-21 11:09:15 +00:00
|
|
|
import { IReduxState } from '../../../app/types';
|
2022-07-18 13:16:08 +00:00
|
|
|
import { connect } from '../../../base/redux/functions';
|
|
|
|
// @ts-ignore
|
2022-05-03 10:07:22 +00:00
|
|
|
import { isDesktopShareButtonDisabled } from '../../functions.native';
|
2021-05-26 08:43:24 +00:00
|
|
|
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2021-03-05 15:33:53 +00:00
|
|
|
import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
|
2022-07-18 13:16:08 +00:00
|
|
|
// @ts-ignore
|
2021-03-05 15:33:53 +00:00
|
|
|
import ScreenSharingIosButton from './ScreenSharingIosButton.js';
|
|
|
|
|
2022-07-18 13:16:08 +00:00
|
|
|
const ScreenSharingButton = (props: any) => (
|
2021-03-05 15:33:53 +00:00
|
|
|
<>
|
|
|
|
{Platform.OS === 'android'
|
|
|
|
&& <ScreenSharingAndroidButton { ...props } />
|
|
|
|
}
|
|
|
|
{Platform.OS === 'ios'
|
|
|
|
&& <ScreenSharingIosButton { ...props } />
|
|
|
|
}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
2021-05-26 08:43:24 +00:00
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the associated props for the
|
|
|
|
* {@code ScreenSharingButton} component.
|
|
|
|
*
|
2022-07-11 12:30:37 +00:00
|
|
|
* @param {Object} state - The Redux state.
|
2021-05-26 08:43:24 +00:00
|
|
|
* @private
|
2022-07-11 12:30:37 +00:00
|
|
|
* @returns {Object}
|
2021-05-26 08:43:24 +00:00
|
|
|
*/
|
2022-10-21 11:09:15 +00:00
|
|
|
function _mapStateToProps(state: IReduxState) {
|
2021-05-26 08:43:24 +00:00
|
|
|
return {
|
2022-05-03 10:07:22 +00:00
|
|
|
_disabled: isDesktopShareButtonDisabled(state)
|
2021-05-26 08:43:24 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(ScreenSharingButton);
|