mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 15:14:18 +00:00
add touchable for circle
This commit is contained in:
+8
-3
@@ -1,12 +1,16 @@
|
|||||||
import React, {PropTypes, Component} from 'react';
|
import React, {PropTypes} from 'react';
|
||||||
import extractProps from '../lib/extract/extractProps';
|
|
||||||
import createNativeComponent from '../lib/createNativeComponent';
|
import createNativeComponent from '../lib/createNativeComponent';
|
||||||
|
import Shape from './Shape';
|
||||||
import mergeContext from '../lib/mergeContext';
|
import mergeContext from '../lib/mergeContext';
|
||||||
import {circleProps, pathProps, fillProps, strokeProps, numberProp} from '../lib/props';
|
import {circleProps, pathProps, fillProps, strokeProps, numberProp, touchableProps, responderProps} from '../lib/props';
|
||||||
|
|
||||||
|
class Circle extends Shape {
|
||||||
static displayName = 'Circle';
|
static displayName = 'Circle';
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...pathProps,
|
...pathProps,
|
||||||
|
...circleProps,
|
||||||
|
...touchableProps,
|
||||||
|
...responderProps
|
||||||
};
|
};
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
@@ -20,6 +24,7 @@ import {circleProps, pathProps, fillProps, strokeProps, numberProp} from '../lib
|
|||||||
render() {
|
render() {
|
||||||
let props = mergeContext(this.props, this.context);
|
let props = mergeContext(this.props, this.context);
|
||||||
return <RNSVGCircle
|
return <RNSVGCircle
|
||||||
|
{...this.extractProps(props)}
|
||||||
cx={props.cx.toString()}
|
cx={props.cx.toString()}
|
||||||
cy={props.cy.toString()}
|
cy={props.cy.toString()}
|
||||||
r={props.r.toString()}
|
r={props.r.toString()}
|
||||||
|
|||||||
Reference in New Issue
Block a user