2022-02-09 02:17:07 +02:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
export const CircularProgress = ({ size, strokeWidth }) => {
|
|
|
|
const viewBox = `0 0 ${size} ${size}`;
|
|
|
|
const radius = (size - strokeWidth) / 2;
|
|
|
|
|
|
|
|
return (
|
2022-02-22 21:14:17 +02:00
|
|
|
<svg width={size} height={size} viewBox={viewBox} className='circular-progress' role='progressbar'>
|
2022-02-09 02:17:07 +02:00
|
|
|
<circle
|
|
|
|
fill='none'
|
|
|
|
cx={size / 2}
|
|
|
|
cy={size / 2}
|
|
|
|
r={radius}
|
|
|
|
strokeWidth={`${strokeWidth}px`}
|
|
|
|
/>
|
|
|
|
</svg>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
CircularProgress.propTypes = {
|
|
|
|
size: PropTypes.number.isRequired,
|
|
|
|
strokeWidth: PropTypes.number.isRequired,
|
|
|
|
};
|
2016-11-16 18:20:52 +02:00
|
|
|
|
2017-01-10 14:50:40 +02:00
|
|
|
const LoadingIndicator = () => (
|
2017-04-23 05:26:55 +03:00
|
|
|
<div className='loading-indicator'>
|
2022-02-09 02:17:07 +02:00
|
|
|
<CircularProgress size={50} strokeWidth={6} />
|
2017-01-10 14:50:40 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2016-10-06 23:47:35 +03:00
|
|
|
export default LoadingIndicator;
|