2017-05-02 20:04:16 -04:00
|
|
|
import React from 'react';
|
2022-02-08 19:17:07 -05:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
export const CircularProgress = ({ size, strokeWidth }) => {
|
|
|
|
const viewBox = `0 0 ${size} ${size}`;
|
|
|
|
const radius = (size - strokeWidth) / 2;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<svg width={size} heigh={size} viewBox={viewBox} className='circular-progress' role='progressbar'>
|
|
|
|
<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 11:20:52 -05:00
|
|
|
|
2017-01-10 07:50:40 -05:00
|
|
|
const LoadingIndicator = () => (
|
2017-04-22 22:26:55 -04:00
|
|
|
<div className='loading-indicator'>
|
2022-02-08 19:17:07 -05:00
|
|
|
<CircularProgress size={50} strokeWidth={6} />
|
2017-01-10 07:50:40 -05:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2016-10-06 16:47:35 -04:00
|
|
|
export default LoadingIndicator;
|