2023-02-14 09:50:46 +00:00
|
|
|
import React, { Component, ReactChildren } from 'react';
|
2018-10-30 05:02:23 +00:00
|
|
|
|
2017-03-06 22:03:50 +00:00
|
|
|
/**
|
2018-10-30 05:02:23 +00:00
|
|
|
* The type of the React {@code Component} props of {@link OverlayFrame}.
|
2017-03-06 22:03:50 +00:00
|
|
|
*/
|
2018-10-30 05:02:23 +00:00
|
|
|
type Props = {
|
|
|
|
|
2017-03-06 22:03:50 +00:00
|
|
|
/**
|
2018-10-30 05:02:23 +00:00
|
|
|
* The children components to be displayed into the overlay frame.
|
|
|
|
*/
|
2023-02-14 09:50:46 +00:00
|
|
|
children: ReactChildren;
|
2018-10-30 05:02:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the css style of the overlay. If true, then lighter; darker,
|
|
|
|
* otherwise.
|
|
|
|
*/
|
2023-02-14 09:50:46 +00:00
|
|
|
isLightOverlay?: boolean;
|
2022-03-10 13:31:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The style property.
|
|
|
|
*/
|
2023-02-14 09:50:46 +00:00
|
|
|
style: Object;
|
2018-10-30 05:02:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a React {@link Component} for the frame of the overlays.
|
|
|
|
*/
|
2020-11-10 22:21:07 +00:00
|
|
|
export default class OverlayFrame extends Component<Props> {
|
2017-03-06 22:03:50 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement|null}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div
|
2020-11-10 22:21:07 +00:00
|
|
|
className = { this.props.isLightOverlay ? 'overlay__container-light' : 'overlay__container' }
|
2022-03-10 13:31:27 +00:00
|
|
|
id = 'overlay'
|
|
|
|
style = { this.props.style }>
|
2020-11-10 22:21:07 +00:00
|
|
|
<div className = { 'overlay__content' }>
|
2017-03-06 22:03:50 +00:00
|
|
|
{
|
|
|
|
this.props.children
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|