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