mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 05:55:10 +00:00
add touchableProps and responderProps into propTypes
This commit is contained in:
@@ -2,15 +2,13 @@ import React, {PropTypes} from 'react';
|
|||||||
import createNativeComponent from '../lib/createNativeComponent';
|
import createNativeComponent from '../lib/createNativeComponent';
|
||||||
import Shape from './Shape';
|
import Shape from './Shape';
|
||||||
import mergeContext from '../lib/mergeContext';
|
import mergeContext from '../lib/mergeContext';
|
||||||
import {circleProps, pathProps, fillProps, strokeProps, numberProp, touchableProps, responderProps} from '../lib/props';
|
import {circleProps, pathProps, fillProps, strokeProps, numberProp} from '../lib/props';
|
||||||
|
|
||||||
class Circle extends Shape {
|
class Circle extends Shape {
|
||||||
static displayName = 'Circle';
|
static displayName = 'Circle';
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...pathProps,
|
...pathProps,
|
||||||
...circleProps,
|
...circleProps
|
||||||
...touchableProps,
|
|
||||||
...responderProps
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, {PropTypes} from 'react';
|
import React, {PropTypes} from 'react';
|
||||||
import createNativeComponent from '../lib/createNativeComponent';
|
import createNativeComponent from '../lib/createNativeComponent';
|
||||||
import {numberProp} from '../lib/props';
|
import {numberProp, touchableProps, responderProps} from '../lib/props';
|
||||||
import Shape from './Shape';
|
import Shape from './Shape';
|
||||||
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
|
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
|
||||||
|
|
||||||
@@ -12,7 +12,9 @@ class Image extends Shape {
|
|||||||
y: numberProp,
|
y: numberProp,
|
||||||
width: numberProp,
|
width: numberProp,
|
||||||
height: numberProp,
|
height: numberProp,
|
||||||
href: PropTypes.number.isRequired
|
href: PropTypes.number.isRequired,
|
||||||
|
...responderProps,
|
||||||
|
...touchableProps
|
||||||
//preserveAspectRatio: PropTypes.string
|
//preserveAspectRatio: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Polygon extends Component{
|
|||||||
static displayName = 'Polygon';
|
static displayName = 'Polygon';
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...pathProps,
|
...pathProps,
|
||||||
points: PropTypes.string
|
points: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Polyline extends Component{
|
|||||||
static displayName = 'Polyline';
|
static displayName = 'Polyline';
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...pathProps,
|
...pathProps,
|
||||||
points: PropTypes.string
|
points: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ class Text extends Shape {
|
|||||||
dx: numberProp,
|
dx: numberProp,
|
||||||
dy: numberProp,
|
dy: numberProp,
|
||||||
...textProps,
|
...textProps,
|
||||||
...fillProps,
|
|
||||||
...strokeProps,
|
|
||||||
...pathProps
|
...pathProps
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ const pathProps = {
|
|||||||
...strokeProps,
|
...strokeProps,
|
||||||
...clipProps,
|
...clipProps,
|
||||||
...transformProps,
|
...transformProps,
|
||||||
...responderProps
|
...responderProps,
|
||||||
|
...touchableProps
|
||||||
};
|
};
|
||||||
|
|
||||||
const circleProps = {
|
const circleProps = {
|
||||||
|
|||||||
Reference in New Issue
Block a user