jiti-meet/react/features/overlay/components/web/PageReloadOverlay.js

53 lines
1.5 KiB
JavaScript
Raw Normal View History

2019-03-06 16:28:59 +00:00
// @flow
import React from 'react';
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';
import OverlayFrame from './OverlayFrame';
/**
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.
*/
2019-03-06 16:28:59 +00:00
class PageReloadOverlay extends AbstractPageReloadOverlay<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
2017-09-22 20:01:51 +00:00
* @returns {ReactElement}
*/
render() {
const { isNetworkFailure, t } = this.props;
const { message, timeLeft, title } = this.state;
return (
<OverlayFrame isLightOverlay = { isNetworkFailure }>
<div className = 'inlay'>
<span
className = 'reload_overlay_title'>
{ t(title) }
</span>
<span className = 'reload_overlay_text'>
{ t(message, { seconds: timeLeft }) }
</span>
{ this._renderProgressBar() }
{ this._renderButton() }
</div>
</OverlayFrame>
);
}
2019-03-06 16:28:59 +00:00
_renderButton: () => React$Element<*>
_renderProgressBar: () => React$Element<*>
}
export default translate(connect(abstractMapStateToProps)(PageReloadOverlay));