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 }>
|
2021-06-10 12:48:44 +00:00
|
|
|
<div
|
|
|
|
aria-describedby = 'reload_overlay_text'
|
|
|
|
aria-labelledby = 'reload_overlay_title'
|
|
|
|
className = 'inlay'
|
|
|
|
role = 'dialog'>
|
2017-03-06 22:03:50 +00:00
|
|
|
<span
|
2021-06-10 12:48:44 +00:00
|
|
|
className = 'reload_overlay_title'
|
|
|
|
id = 'reload_overlay_title'
|
|
|
|
role = 'heading'>
|
2017-03-09 00:16:53 +00:00
|
|
|
{ t(title) }
|
2017-03-06 22:03:50 +00:00
|
|
|
</span>
|
2021-06-10 12:48:44 +00:00
|
|
|
<span
|
|
|
|
className = 'reload_overlay_text'
|
|
|
|
id = 'reload_overlay_text'>
|
2017-03-09 00:16:53 +00:00
|
|
|
{ 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));
|