lbry-desktop/ui/component/common/loading-screen.jsx

30 lines
710 B
React
Raw Normal View History

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