2017-11-09 14:34:42 +01:00
|
|
|
import { Component } from 'react';
|
2023-03-29 10:04:23 +03:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
|
|
import { IReduxState } from '../../../app/types';
|
2017-11-09 14:34:42 +01:00
|
|
|
|
2018-10-29 22:02:23 -07:00
|
|
|
/**
|
|
|
|
|
* Implements a React {@link Component} for suspended overlay. Shown when a
|
|
|
|
|
* suspend is detected.
|
|
|
|
|
*/
|
2023-04-03 11:09:50 +03:00
|
|
|
export default class AbstractSuspendedOverlay extends Component<WithTranslation> {
|
2017-11-09 14:34:42 +01:00
|
|
|
/**
|
2017-11-27 16:08:12 -06:00
|
|
|
* Determines whether this overlay needs to be rendered (according to a
|
|
|
|
|
* specific redux state). Called by {@link OverlayContainer}.
|
2017-11-09 14:34:42 +01:00
|
|
|
*
|
|
|
|
|
* @param {Object} state - The redux state.
|
2017-11-27 16:08:12 -06:00
|
|
|
* @returns {boolean} - If this overlay needs to be rendered, {@code true};
|
|
|
|
|
* {@code false}, otherwise.
|
2017-11-09 14:34:42 +01:00
|
|
|
*/
|
2023-03-29 10:04:23 +03:00
|
|
|
static needsRender(state: IReduxState) {
|
2023-02-14 11:50:46 +02:00
|
|
|
return state['features/power-monitor']?.suspendDetected;
|
2017-11-09 14:34:42 +01:00
|
|
|
}
|
|
|
|
|
}
|