2017-03-09 00:16:53 +00:00
|
|
|
import React from 'react';
|
2017-05-31 05:31:00 +00:00
|
|
|
import { connect } from 'react-redux';
|
2017-01-31 20:58:48 +00:00
|
|
|
|
2017-03-01 02:55:12 +00:00
|
|
|
import { translate } from '../../base/i18n';
|
2017-01-31 20:58:48 +00:00
|
|
|
|
2017-03-09 00:16:53 +00:00
|
|
|
import AbstractPageReloadOverlay from './AbstractPageReloadOverlay';
|
2017-03-06 22:03:50 +00:00
|
|
|
import OverlayFrame from './OverlayFrame';
|
2017-01-31 20:58:48 +00:00
|
|
|
|
|
|
|
/**
|
2017-02-19 00:42:11 +00:00
|
|
|
* Implements a React Component for page reload overlay. Shown before the
|
|
|
|
* conference is reloaded. Shows a warning message and counts down towards the
|
|
|
|
* reload.
|
2017-01-31 20:58:48 +00:00
|
|
|
*/
|
2017-03-09 00:16:53 +00:00
|
|
|
class PageReloadOverlay extends AbstractPageReloadOverlay {
|
2017-01-31 20:58:48 +00:00
|
|
|
/**
|
2017-03-06 22:03:50 +00:00
|
|
|
* Implements React's {@link Component#render()}.
|
2017-01-31 20:58:48 +00:00
|
|
|
*
|
2017-03-06 22:03:50 +00:00
|
|
|
* @inheritdoc
|
2017-09-22 20:01:51 +00:00
|
|
|
* @returns {ReactElement}
|
2017-01-31 20:58:48 +00:00
|
|
|
*/
|
2017-03-06 22:03:50 +00:00
|
|
|
render() {
|
2017-03-09 00:16:53 +00:00
|
|
|
const { isNetworkFailure, t } = this.props;
|
|
|
|
const { message, timeLeft, title } = this.state;
|
2017-01-31 20:58:48 +00:00
|
|
|
|
|
|
|
return (
|
2017-03-09 00:16:53 +00:00
|
|
|
<OverlayFrame isLightOverlay = { isNetworkFailure }>
|
2017-03-06 22:03:50 +00:00
|
|
|
<div className = 'inlay'>
|
|
|
|
<span
|
|
|
|
className = 'reload_overlay_title'>
|
2017-03-09 00:16:53 +00:00
|
|
|
{ t(title) }
|
2017-03-06 22:03:50 +00:00
|
|
|
</span>
|
2017-03-09 00:16:53 +00:00
|
|
|
<span className = 'reload_overlay_text'>
|
|
|
|
{ t(message, { seconds: timeLeft }) }
|
2017-03-06 22:03:50 +00:00
|
|
|
</span>
|
2017-03-09 00:16:53 +00:00
|
|
|
{ this._renderProgressBar() }
|
2017-03-06 22:03:50 +00:00
|
|
|
{ this._renderButton() }
|
|
|
|
</div>
|
|
|
|
</OverlayFrame>
|
2017-01-31 20:58:48 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-02-23 16:56:25 +00:00
|
|
|
|
2017-05-31 05:31:00 +00:00
|
|
|
export default translate(connect()(PageReloadOverlay));
|