Co-authored-by: mashal-m <mashal.malik@arbisoft.com> Co-authored-by: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com>
38 lines
777 B
JavaScript
38 lines
777 B
JavaScript
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Spinner } from '@openedx/paragon';
|
|
|
|
export default class PageLoading extends Component {
|
|
renderSrMessage() {
|
|
if (!this.props.srMessage) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<span className="sr-only">
|
|
{this.props.srMessage}
|
|
</span>
|
|
);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div>
|
|
<div
|
|
className="d-flex justify-content-center align-items-center flex-column"
|
|
style={{
|
|
height: '50vh',
|
|
}}
|
|
>
|
|
<Spinner animation="border" variant="primary" screenReaderText={this.renderSrMessage()} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
PageLoading.propTypes = {
|
|
srMessage: PropTypes.node.isRequired,
|
|
};
|