2017-11-09 13:34:42 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Component } from 'react';
|
|
|
|
|
|
|
|
/**
|
2017-11-27 22:08:12 +00:00
|
|
|
* Implements a React {@link Component} for suspended overlay. Shown when a
|
|
|
|
* suspend is detected.
|
2017-11-09 13:34:42 +00:00
|
|
|
*/
|
|
|
|
export default class AbstractSuspendedOverlay extends Component {
|
|
|
|
/**
|
2017-11-27 22:08:12 +00:00
|
|
|
* {@code AbstractSuspendedOverlay} component's property types.
|
2017-11-09 13:34:42 +00:00
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*/
|
|
|
|
static propTypes = {
|
|
|
|
/**
|
|
|
|
* The function to translate human-readable text.
|
|
|
|
*
|
|
|
|
* @public
|
|
|
|
* @type {Function}
|
|
|
|
*/
|
|
|
|
t: PropTypes.func
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2017-11-27 22:08:12 +00:00
|
|
|
* Determines whether this overlay needs to be rendered (according to a
|
|
|
|
* specific redux state). Called by {@link OverlayContainer}.
|
2017-11-09 13:34:42 +00:00
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
2017-11-27 22:08:12 +00:00
|
|
|
* @returns {boolean} - If this overlay needs to be rendered, {@code true};
|
|
|
|
* {@code false}, otherwise.
|
2017-11-09 13:34:42 +00:00
|
|
|
*/
|
|
|
|
static needsRender(state) {
|
|
|
|
return state['features/overlay'].suspendDetected;
|
|
|
|
}
|
|
|
|
}
|