diff --git a/src/Button/index.android.js b/src/Button/index.android.js new file mode 100644 index 0000000..359e0be --- /dev/null +++ b/src/Button/index.android.js @@ -0,0 +1,32 @@ +import React from 'react'; +import {TouchableOpacity, View } from 'react-native'; +import PropTypes from 'prop-types'; + +export default class CButton extends React.Component { + render() { + const {style,activeOpacity, ...passThroughProps} = this.props; + return ( + + + {this.props.children} + + + ) + } +} + +CButton.propTypes = { + /** + * Callback to be invoked when the button is pressed + */ + onPress: PropTypes.func.isRequired, + /** + * Boolean value to disable or enable button + */ + disabled: PropTypes.bool, + /** + * Style of the Button + */ + style:PropTypes.object +}; diff --git a/src/Button/index.ios.js b/src/Button/index.ios.js new file mode 100644 index 0000000..359e0be --- /dev/null +++ b/src/Button/index.ios.js @@ -0,0 +1,32 @@ +import React from 'react'; +import {TouchableOpacity, View } from 'react-native'; +import PropTypes from 'prop-types'; + +export default class CButton extends React.Component { + render() { + const {style,activeOpacity, ...passThroughProps} = this.props; + return ( + + + {this.props.children} + + + ) + } +} + +CButton.propTypes = { + /** + * Callback to be invoked when the button is pressed + */ + onPress: PropTypes.func.isRequired, + /** + * Boolean value to disable or enable button + */ + disabled: PropTypes.bool, + /** + * Style of the Button + */ + style:PropTypes.object +}; diff --git a/src/Button/index.js b/src/Button/index.js index 2f07385..6e87fcf 100644 --- a/src/Button/index.js +++ b/src/Button/index.js @@ -1,24 +1,32 @@ import React from 'react'; -import { Button, View } from 'react-native'; +import {TouchableOpacity, View } from 'react-native'; import PropTypes from 'prop-types'; export default class CButton extends React.Component { render() { - const {style, ...passThroughProps} = this.props; - const {color, ...passThroughStyles} = style || {}; + const {style,activeOpacity, ...passThroughProps} = this.props; return ( - -