3
0

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. export default class ButtonComp extends Module {
  8. constructor(props) {
  9. super(props);
  10. }
  11. press(){
  12. console.log("######You must over write this function@@@@@")
  13. }
  14. display() {
  15. let {
  16. title,
  17. textColor,
  18. width,
  19. height,
  20. borderRadius,
  21. FontSize,
  22. backgroundColor
  23. } = this.props;
  24. return (
  25. <Button
  26. onPress = {this.props.press || this.press}
  27. title={title || "submit"}
  28. accessibilityLabel="Learn more about this purple button"
  29. titleStyle = {{color:textColor,fontSize:FontSize}}
  30. buttonStyle = {{backgroundColor:backgroundColor,width:width,height:height,borderRadius:borderRadius}}
  31. />
  32. )
  33. }
  34. }
  35. ButtonComp.Inputs = {
  36. title: new Types.Text().require().default('Submit'),
  37. textColor: new Types.Text().require().color().default('rgba(255, 255, 255, 1)'),
  38. //
  39. backgroundColor: new Types.Text().require().color().default('rgba(73, 156, 219, 1)'),
  40. borderRadius: new Types.Integer().require().default(0),
  41. FontSize: new Types.Integer().require().default(18),
  42. width: new Types.Integer().require(),
  43. height: new Types.Integer().require()
  44. }
  45. ButtonComp.Styles = Styles;