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.

OverlayFrame.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React, { Component } from 'react';
  2. /**
  3. * Implements an abstract React Component for overlay - the components which are
  4. * displayed on top of the application covering the whole screen.
  5. *
  6. * @abstract
  7. */
  8. export default class OverlayFrame extends Component {
  9. /**
  10. * OverlayFrame component's property types.
  11. *
  12. * @static
  13. */
  14. static propTypes = {
  15. /**
  16. * The children components to be displayed into the overlay frame.
  17. */
  18. children: React.PropTypes.node.isRequired,
  19. /**
  20. * Indicates the css style of the overlay. If true, then lighter;
  21. * darker, otherwise.
  22. *
  23. * @type {boolean}
  24. */
  25. isLightOverlay: React.PropTypes.bool
  26. }
  27. /**
  28. * Implements React's {@link Component#render()}.
  29. *
  30. * @inheritdoc
  31. * @returns {ReactElement|null}
  32. */
  33. render() {
  34. const containerClass = this.props.isLightOverlay
  35. ? 'overlay__container-light' : 'overlay__container';
  36. return (
  37. <div
  38. className = { containerClass }
  39. id = 'overlay'>
  40. <div className = 'overlay__content'>
  41. {
  42. this.props.children
  43. }
  44. </div>
  45. </div>
  46. );
  47. }
  48. }