2017-05-03 02:04:16 +02:00
|
|
|
import React from 'react';
|
2022-02-09 01:17:07 +01: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 20:14:17 +01:00
|
|
|
<svg width={size} height={size} viewBox={viewBox} className='circular-progress' role='progressbar'>
|
2022-02-09 01:17:07 +01: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 17:20:52 +01:00
|
|
|
|
2017-01-10 13:50:40 +01:00
|
|
|
const LoadingIndicator = () => (
|
2017-04-23 04:26:55 +02:00
|
|
|
<div className='loading-indicator'>
|
2022-02-09 01:17:07 +01:00
|
|
|
<CircularProgress size={50} strokeWidth={6} />
|
2017-01-10 13:50:40 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2016-10-06 22:47:35 +02:00
|
|
|
export default LoadingIndicator;
|