2019-04-09 13:05:20 +02:00
|
|
|
// @flow
|
2017-11-16 12:26:14 -06:00
|
|
|
|
2017-03-06 16:03:50 -06:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
2018-10-29 22:02:23 -07:00
|
|
|
declare var interfaceConfig: Object;
|
|
|
|
|
|
2017-03-06 16:03:50 -06:00
|
|
|
/**
|
2018-10-29 22:02:23 -07:00
|
|
|
* The type of the React {@code Component} props of {@link OverlayFrame}.
|
2017-03-06 16:03:50 -06:00
|
|
|
*/
|
2018-10-29 22:02:23 -07:00
|
|
|
type Props = {
|
|
|
|
|
|
2017-03-06 16:03:50 -06:00
|
|
|
/**
|
2018-10-29 22:02:23 -07:00
|
|
|
* The children components to be displayed into the overlay frame.
|
|
|
|
|
*/
|
|
|
|
|
children: React$Node,
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates the css style of the overlay. If true, then lighter; darker,
|
|
|
|
|
* otherwise.
|
|
|
|
|
*/
|
2019-03-06 17:28:59 +01:00
|
|
|
isLightOverlay?: boolean
|
2018-10-29 22:02:23 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements a React {@link Component} for the frame of the overlays.
|
|
|
|
|
*/
|
2020-11-10 16:21:07 -06:00
|
|
|
export default class OverlayFrame extends Component<Props> {
|
2017-03-06 16:03:50 -06:00
|
|
|
/**
|
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
|
*
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
* @returns {ReactElement|null}
|
|
|
|
|
*/
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
2020-11-10 16:21:07 -06:00
|
|
|
className = { this.props.isLightOverlay ? 'overlay__container-light' : 'overlay__container' }
|
2017-03-06 16:03:50 -06:00
|
|
|
id = 'overlay'>
|
2020-11-10 16:21:07 -06:00
|
|
|
<div className = { 'overlay__content' }>
|
2017-03-06 16:03:50 -06:00
|
|
|
{
|
|
|
|
|
this.props.children
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|