lbry-desktop/ui/component/common/loading-screen.jsx
2020-04-30 15:13:45 -04:00

29 lines
710 B
JavaScript

// @flow
import React from 'react';
import classnames from 'classnames';
import Spinner from 'component/spinner';
type Props = {
status?: string,
spinner: boolean,
isDocument: boolean,
};
class LoadingScreen extends React.PureComponent<Props> {
static defaultProps = {
spinner: true,
isDocument: false,
};
render() {
const { status, spinner, isDocument } = this.props;
return (
<div className={classnames('content__loading', { 'content__loading--document': isDocument })}>
{spinner && <Spinner light={!isDocument} />}
{status && <span className={classnames('content__loading-text')}>{status}</span>}
</div>
);
}
}
export default LoadingScreen;