2017-03-06 22:03:50 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2017-03-09 00:16:53 +00:00
|
|
|
declare var interfaceConfig: Object;
|
|
|
|
|
2017-03-06 22:03:50 +00:00
|
|
|
/**
|
2017-03-09 00:16:53 +00:00
|
|
|
* Implements a React Component for the frame of the overlays.
|
2017-03-06 22:03:50 +00:00
|
|
|
*/
|
|
|
|
export default class OverlayFrame extends Component {
|
|
|
|
/**
|
|
|
|
* OverlayFrame component's property types.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*/
|
|
|
|
static propTypes = {
|
|
|
|
/**
|
|
|
|
* The children components to be displayed into the overlay frame.
|
|
|
|
*/
|
|
|
|
children: React.PropTypes.node.isRequired,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the css style of the overlay. If true, then lighter;
|
|
|
|
* darker, otherwise.
|
|
|
|
*
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
isLightOverlay: React.PropTypes.bool
|
|
|
|
}
|
|
|
|
|
2017-03-09 00:16:53 +00:00
|
|
|
/**
|
|
|
|
* Initializes a new AbstractOverlay instance.
|
|
|
|
*
|
|
|
|
* @param {Object} props - The read-only properties with which the new
|
|
|
|
* instance is to be initialized.
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
/**
|
2017-04-10 17:59:44 +00:00
|
|
|
* Indicates whether the filmstrip only mode is enabled or not.
|
2017-03-09 00:16:53 +00:00
|
|
|
*
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
2017-04-10 17:59:44 +00:00
|
|
|
filmstripOnly: interfaceConfig.filmStripOnly
|
2017-03-09 00:16:53 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-03-06 22:03:50 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement|null}
|
|
|
|
*/
|
|
|
|
render() {
|
2017-03-09 00:16:53 +00:00
|
|
|
let containerClass = this.props.isLightOverlay
|
2017-03-06 22:03:50 +00:00
|
|
|
? 'overlay__container-light' : 'overlay__container';
|
2017-03-09 00:16:53 +00:00
|
|
|
let contentClass = 'overlay__content';
|
|
|
|
|
2017-04-10 17:59:44 +00:00
|
|
|
if (this.state.filmstripOnly) {
|
2017-03-09 00:16:53 +00:00
|
|
|
containerClass += ' filmstrip-only';
|
|
|
|
contentClass += ' filmstrip-only';
|
|
|
|
}
|
2017-03-06 22:03:50 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className = { containerClass }
|
|
|
|
id = 'overlay'>
|
2017-03-09 00:16:53 +00:00
|
|
|
<div className = { contentClass }>
|
2017-03-06 22:03:50 +00:00
|
|
|
{
|
|
|
|
this.props.children
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|