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