mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Did find and replace in TextMate.
```
find: (?:( \*)( ))?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+(?:this source tree|the same directory)\.$
replace: $1$2Copyright (c) $3-present, Facebook, Inc.\n$1\n$1$2This source code is licensed under the MIT license found in the\n$1$2LICENSE file in the root directory of this source tree.
```
53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
|
|
/**
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @providesModule Circle.art
|
|
* @typechecks
|
|
*
|
|
* Example usage:
|
|
* <Circle
|
|
* radius={10}
|
|
* stroke="green"
|
|
* strokeWidth={3}
|
|
* fill="blue"
|
|
* />
|
|
*
|
|
*/
|
|
|
|
var PropTypes = require('prop-types');
|
|
var React = require('react');
|
|
var ReactART = require('..');
|
|
|
|
var createReactClass = require('create-react-class');
|
|
|
|
var Path = ReactART.Path;
|
|
var Shape = ReactART.Shape;
|
|
|
|
/**
|
|
* Circle is a React component for drawing circles. Like other ReactART
|
|
* components, it must be used in a <Surface>.
|
|
*/
|
|
var Circle = createReactClass({
|
|
displayName: 'Circle',
|
|
|
|
propTypes: {
|
|
radius: PropTypes.number.isRequired
|
|
},
|
|
|
|
render: function render() {
|
|
var radius = this.props.radius;
|
|
|
|
var path = Path().moveTo(0, -radius).arc(0, radius * 2, radius).arc(0, radius * -2, radius).close();
|
|
return React.createElement(Shape, _extends({}, this.props, { d: path }));
|
|
}
|
|
});
|
|
|
|
module.exports = Circle;
|