2019-03-06 16:28:59 +00:00
|
|
|
// @flow
|
|
|
|
|
2017-03-09 00:16:53 +00:00
|
|
|
import React from 'react';
|
2017-01-31 20:58:48 +00:00
|
|
|
|
2019-04-09 11:05:20 +00:00
|
|
|
import { translate } from '../../../base/i18n';
|
|
|
|
import { connect } from '../../../base/redux';
|
2019-03-06 16:28:59 +00:00
|
|
|
import AbstractPageReloadOverlay, {
|
|
|
|
abstractMapStateToProps,
|
|
|
|
type Props
|
2019-04-09 11:05:20 +00:00
|
|
|
} 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
|
|
|
*/
|
2019-03-06 16:28:59 +00:00
|
|
|
class PageReloadOverlay extends AbstractPageReloadOverlay<Props> {
|
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
|
|
|
);
|
|
|
|
}
|
2019-03-06 16:28:59 +00:00
|
|
|
|
|
|
|
_renderButton: () => React$Element<*>
|
|
|
|
|
|
|
|
_renderProgressBar: () => React$Element<*>
|
2017-01-31 20:58:48 +00:00
|
|
|
}
|
2017-02-23 16:56:25 +00:00
|
|
|
|
2017-11-09 13:34:42 +00:00
|
|
|
export default translate(connect(abstractMapStateToProps)(PageReloadOverlay));
|