mirror of https://github.com/jitsi/jitsi-meet
In this case makes more sense to have overlay frame included in every overlay instead of abstract class that implements the overlay frame and have to be extended by every overlay. In addition, mapStateToProps isn't working well with inheritance.pull/1393/head
parent
f47bc1163b
commit
c461e8b63c
@ -1,80 +0,0 @@ |
||||
/* global APP */ |
||||
|
||||
import React, { Component } from 'react'; |
||||
|
||||
/** |
||||
* Implements an abstract React Component for overlay - the components which are |
||||
* displayed on top of the application covering the whole screen. |
||||
* |
||||
* @abstract |
||||
*/ |
||||
export default class AbstractOverlay extends Component { |
||||
/** |
||||
* 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 = { |
||||
/** |
||||
* Indicates the CSS style of the overlay. If true, then ighter; |
||||
* darker, otherwise. |
||||
* |
||||
* @type {boolean} |
||||
*/ |
||||
isLightOverlay: false |
||||
}; |
||||
} |
||||
|
||||
/** |
||||
* Implements React's {@link Component#render()}. |
||||
* |
||||
* @inheritdoc |
||||
* @returns {ReactElement|null} |
||||
*/ |
||||
render() { |
||||
const containerClass |
||||
= this.state.isLightOverlay |
||||
? 'overlay__container-light' |
||||
: 'overlay__container'; |
||||
|
||||
return ( |
||||
<div |
||||
className = { containerClass } |
||||
id = 'overlay'> |
||||
<div className = 'overlay__content'> |
||||
{ |
||||
this._renderOverlayContent() |
||||
} |
||||
</div> |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* Reloads the page. |
||||
* |
||||
* @returns {void} |
||||
* @protected |
||||
*/ |
||||
_reconnectNow() { |
||||
// FIXME: In future we should dispatch an action here that will result
|
||||
// in reload.
|
||||
APP.ConferenceUrl.reload(); |
||||
} |
||||
|
||||
/** |
||||
* Abstract method which should be used by subclasses to provide the overlay |
||||
* content. |
||||
* |
||||
* @returns {ReactElement|null} |
||||
* @protected |
||||
*/ |
||||
_renderOverlayContent() { |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,52 @@ |
||||
import React, { Component } from 'react'; |
||||
|
||||
/** |
||||
* Implements an abstract React Component for overlay - the components which are |
||||
* displayed on top of the application covering the whole screen. |
||||
* |
||||
* @abstract |
||||
*/ |
||||
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 |
||||
} |
||||
|
||||
/** |
||||
* Implements React's {@link Component#render()}. |
||||
* |
||||
* @inheritdoc |
||||
* @returns {ReactElement|null} |
||||
*/ |
||||
render() { |
||||
const containerClass = this.props.isLightOverlay |
||||
? 'overlay__container-light' : 'overlay__container'; |
||||
|
||||
return ( |
||||
<div |
||||
className = { containerClass } |
||||
id = 'overlay'> |
||||
<div className = 'overlay__content'> |
||||
{ |
||||
this.props.children |
||||
} |
||||
</div> |
||||
</div> |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
/* global APP */ |
||||
/** |
||||
* Reloads the page. |
||||
* |
||||
* @returns {void} |
||||
* @protected |
||||
*/ |
||||
export function reconnectNow() { |
||||
// FIXME: In future we should dispatch an action here that will result
|
||||
// in reload.
|
||||
APP.ConferenceUrl.reload(); |
||||
} |
Loading…
Reference in new issue