UNPKG

react-native-loader

Version:

A collection of loading spinners animated for react native

25 lines (20 loc) 573 B
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Shape, Path } from '@react-native-community/art'; export default class Bar extends Component { static propTypes = { width: PropTypes.number.isRequired, height: PropTypes.number.isRequired }; render() { const { width, height } = this.props; const path = Path() .moveTo(width / -2, height * -1.5) .line(0, height) .line(width, 0) .line(0, height) .line(-width, 0) .close(); return <Shape {...this.props} d={path}/>; } }