2022-01-06 03:47:26 +01:00
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { getAppIsLoading } from '../../../selectors';
|
|
|
|
import Spinner from '../../ui/spinner';
|
|
|
|
|
|
|
|
const AppLoadingSpinner = ({ className }) => {
|
|
|
|
const appIsLoading = useSelector(getAppIsLoading);
|
|
|
|
|
|
|
|
if (!appIsLoading) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={`${className} app-loading-spinner`}
|
|
|
|
role="alert"
|
|
|
|
aria-busy="true"
|
|
|
|
>
|
2022-03-25 16:32:36 +01:00
|
|
|
<Spinner
|
|
|
|
color="var(--color-secondary-muted)"
|
|
|
|
className="app-loading-spinner__inner"
|
|
|
|
/>
|
2022-01-06 03:47:26 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
AppLoadingSpinner.propTypes = {
|
|
|
|
className: PropTypes.string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AppLoadingSpinner;
|