2017-11-24 15:23:40 +00:00
|
|
|
// @flow
|
|
|
|
|
2018-05-23 12:30:42 +00:00
|
|
|
import React, { Component, type Node } from 'react';
|
|
|
|
import { SafeAreaView } from 'react-native';
|
2017-11-24 15:23:40 +00:00
|
|
|
|
|
|
|
import { overlayFrame as styles } from './styles';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@code OverlayFrame}.
|
|
|
|
*/
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The children components to be displayed into the overlay frame.
|
|
|
|
*/
|
2018-05-23 12:30:42 +00:00
|
|
|
children: Node,
|
2017-11-24 15:23:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a React component to act as the frame for overlays.
|
|
|
|
*/
|
|
|
|
export default class OverlayFrame extends Component<Props> {
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
2018-05-23 12:30:42 +00:00
|
|
|
* @returns {ReactElement}
|
2017-11-24 15:23:40 +00:00
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
2018-05-23 12:30:42 +00:00
|
|
|
<SafeAreaView style = { styles.container }>
|
2017-11-24 15:23:40 +00:00
|
|
|
{ this.props.children }
|
2018-05-23 12:30:42 +00:00
|
|
|
</SafeAreaView>
|
2017-11-24 15:23:40 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|