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