Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/Button/index.android.js
Original file line number Diff line number Diff line change
@@ -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 (
<View style={{width:'100%'}}>
<TouchableOpacity activeOpacity={activeOpacity} {...passThroughProps}
style={style}>
{this.props.children}
</TouchableOpacity>
</View>
)
}
}

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
};
32 changes: 32 additions & 0 deletions src/Button/index.ios.js
Original file line number Diff line number Diff line change
@@ -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 (
<View style={{width:'100%'}}>
<TouchableOpacity activeOpacity={activeOpacity} {...passThroughProps}
style={style}>
{this.props.children}
</TouchableOpacity>
</View>
)
}
}

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
};
28 changes: 18 additions & 10 deletions src/Button/index.js
Original file line number Diff line number Diff line change
@@ -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 (
<View
style={passThroughStyles}>
<Button {...passThroughProps}
color={color}
/>
<View style={{width:'100%'}}>
<TouchableOpacity activeOpacity={activeOpacity} {...passThroughProps}
style={style}>
{this.props.children}
</TouchableOpacity>
</View>
)
}
}

Button.propTypes = {
title: PropTypes.string.isRequired,
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
};