Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
jitsi-meet/react/features/mobile/network-activity/components/NetworkActivityIndicator.js

55 lines
1.3 KiB

/* @flow */
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { LoadingIndicator } from '../../../base/react';
/**
* The type of the React {@code Component} props of
* {@link NetworkActivityIndicator}.
*/
type Props = {
/**
* Indicates whether there is network activity i.e. ongoing network
* requests.
*/
_networkActivity: boolean
};
/**
* The React {@code Component} which renders a progress indicator when there
* are ongoing network requests.
*/
class NetworkActivityIndicator extends Component<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return this.props._networkActivity ? <LoadingIndicator /> : null;
}
}
/**
* Maps (parts of) the redux state to the React {@code Component} props of
* {@code NetworkActivityIndicator}.
*
* @param {Object} state - The redux state.
* @private
* @returns {{
* _networkActivity: boolean
* }}
*/
function _mapStateToProps(state) {
const { requests } = state['features/network-activity'];
return {
_networkActivity: Boolean(requests && requests.size)
};
}
export default connect(_mapStateToProps)(NetworkActivityIndicator);