index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React from 'react';
  2. import Module from '../../lib/Module';
  3. import { View , StyleSheet , Text} from 'react-native';
  4. import Types from '../../lib/Types';
  5. import {Button} from 'react-native-elements'
  6. import Styles from './styles';
  7. console.log("WHATTTTTTTTTTTTTTTTT")
  8. console.log(Styles)
  9. export default class ButtonComp extends Module {
  10. constructor(props) {
  11. super(props);
  12. }
  13. press(){
  14. console.log("######You must over write this function@@@@@")
  15. }
  16. display() {
  17. let {
  18. title,
  19. textColor,
  20. width,
  21. height,
  22. borderRadius,
  23. FontSize,
  24. backgroundColor
  25. } = this.props;
  26. return (
  27. <Button
  28. onPress = {this.props.press || this.press}
  29. title={title || "submit"}
  30. accessibilityLabel="Learn more about this purple button"
  31. titleStyle = {{color:textColor,fontSize:FontSize}}
  32. buttonStyle = {{backgroundColor:backgroundColor,width:width,height:height,borderRadius:borderRadius}}
  33. />
  34. )
  35. }
  36. }
  37. ButtonComp.Inputs = {
  38. title: new Types.Text().require().default('Submit'),
  39. textColor: new Types.Text().require().color().default('black'),
  40. backgroundColor: new Types.Text().require().color().default('rgba(47, 150, 145, 1)'),
  41. borderRadius: new Types.Integer().require(),
  42. FontSize: new Types.Integer().require(),
  43. width: new Types.Integer().require(),
  44. height: new Types.Integer().require()
  45. }
  46. ButtonComp.Styles = Styles;