feat(overlays): switch to flow Props

This commit is contained in:
Saúl Ibarra Corretgé 2017-11-29 11:48:10 +01:00 committed by Lyubo Marinov
parent d88b57d35c
commit 19702671f6
1 changed files with 17 additions and 15 deletions

View File

@ -1,6 +1,5 @@
/* global interfaceConfig */
// @flow
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@ -14,6 +13,8 @@ import UserMediaPermissionsFilmstripOnlyOverlay
from './UserMediaPermissionsFilmstripOnlyOverlay';
import UserMediaPermissionsOverlay from './UserMediaPermissionsOverlay';
declare var interfaceConfig: Object;
/**
* The lazily-initialized list of overlay React {@link Component} types used The
* user interface is filmstrip-only.
@ -38,23 +39,24 @@ let _filmstripOnlyOverlays;
*/
let _nonFilmstripOnlyOverlays;
/**
* OverlayContainer component's property types.
*/
type Props = {
/**
* Type of overlay that should be rendered.
* XXX: We are using 'any' here because overlays are usually wrapped in
* functions, so a 'Node' won't do.
*/
overlay: any
}
/**
* Implements a React {@link Component} that will display the correct overlay
* when needed.
*/
class OverlayContainer extends Component {
/**
* OverlayContainer component's property types.
*
* @static
*/
static propTypes = {
/**
* Type of overlay that should be rendered.
*/
overlay: PropTypes.element
};
class OverlayContainer extends Component<Props> {
/**
* Implements React's {@link Component#render()}.
*