react-native-loader
Version:
A collection of loading spinners animated for react native
23 lines (18 loc) • 523 B
JavaScript
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Shape, Path } from '@react-native-community/art';
export default class Circle extends Component {
static propTypes = {
radius: PropTypes.number.isRequired,
opacity: PropTypes.number
};
render() {
const { radius } = this.props;
const path = Path()
.moveTo(0, -radius)
.arc(0, radius * 2, radius)
.arc(0, radius * -2, radius)
.close();
return <Shape {...this.props} d={path}/>;
}
}