jiti-meet/react/features/invite/components/callee-info/CalleeInfoContainer.js

66 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-12-13 03:58:33 +00:00
// @flow
import React, { Component } from 'react';
2019-03-21 16:38:29 +00:00
import { connect } from '../../../base/redux';
2017-12-13 03:58:33 +00:00
import CalleeInfo from './CalleeInfo';
/**
* The type of the React {@code Component} props of {@code CalleeInfoContainer}.
2017-12-13 03:58:33 +00:00
*/
type Props = {
/**
* The indicator which determines whether {@code CalleeInfo} is to be
* rendered.
*
* @private
*/
_calleeInfoVisible: boolean
};
/**
* Implements a React {@link Component} which depicts the establishment of a
* call with a specific remote callee if there is such a remote callee.
*
* @extends Component
*/
class CalleeInfoContainer extends Component<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return this.props._calleeInfoVisible ? <CalleeInfo /> : null;
}
}
/**
* Maps parts of the redux state to {@link CalleeInfoContainer} (React
* {@code Component}) props.
*
* @param {Object} state - The redux state of which parts are to be mapped to
* {@code CalleeInfoContainer} props.
* @private
* @returns {{
* _calleeInfoVisible: boolean
* }}
*/
function _mapStateToProps(state: Object): Object {
return {
/**
* The indicator which determines whether {@code CalleeInfo} is to be
* rendered.
*
* @private
* @type {boolean}
*/
2018-06-26 22:56:22 +00:00
_calleeInfoVisible: state['features/invite'].calleeInfoVisible
2017-12-13 03:58:33 +00:00
};
}
export default connect(_mapStateToProps)(CalleeInfoContainer);