Button.js 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from 'react';
  2. import Module from '../lib/Module';
  3. import { View, Button , StyleSheet} from 'react-native';
  4. import Types from '../lib/Types';
  5. export default class ButtonComp extends Module {
  6. constructor(props) {
  7. super(props);
  8. }
  9. press(){
  10. console.log("######You must over write this function@@@@@")
  11. }
  12. display() {
  13. let { container , color } = this.props.style || '';
  14. return (
  15. <View key={Math.random()} style={container || defaultButton.container }>
  16. <Button
  17. onPress = {this.props.press || this.press}
  18. title={this.props.title}
  19. color={this.props.color}
  20. accessibilityLabel="Learn more about this purple button"
  21. />
  22. </View>)
  23. }
  24. }
  25. ButtonComp.Inputs = {
  26. title: new Types.Text().require().default('Submit'),
  27. color: new Types.Text().require().color().default('rgba(3, 218, 198, 1)')
  28. }
  29. const defaultButton = StyleSheet.create({
  30. container:{
  31. },
  32. })