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.

AbstractSuspendedOverlay.js 975B

1234567891011121314151617181920212223242526272829303132333435
  1. import PropTypes from 'prop-types';
  2. import { Component } from 'react';
  3. /**
  4. * Implements a React {@link Component} for suspended overlay. Shown when a
  5. * suspend is detected.
  6. */
  7. export default class AbstractSuspendedOverlay extends Component {
  8. /**
  9. * {@code AbstractSuspendedOverlay} component's property types.
  10. *
  11. * @static
  12. */
  13. static propTypes = {
  14. /**
  15. * The function to translate human-readable text.
  16. *
  17. * @public
  18. * @type {Function}
  19. */
  20. t: PropTypes.func
  21. };
  22. /**
  23. * Determines whether this overlay needs to be rendered (according to a
  24. * specific redux state). Called by {@link OverlayContainer}.
  25. *
  26. * @param {Object} state - The redux state.
  27. * @returns {boolean} - If this overlay needs to be rendered, {@code true};
  28. * {@code false}, otherwise.
  29. */
  30. static needsRender(state) {
  31. return state['features/overlay'].suspendDetected;
  32. }
  33. }