3
0

index.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. fontFamily,
  23. backgroundColor
  24. } = this.props;
  25. return (
  26. <Button
  27. onPress = {this.props.press || this.press}
  28. title={title || "submit"}
  29. accessibilityLabel="Learn more about this purple button"
  30. titleStyle = {{color:textColor,fontSize:FontSize,fontFamily:fontFamily}}
  31. buttonStyle = {{backgroundColor:backgroundColor,width:width,height:height,borderRadius:borderRadius}}
  32. />
  33. )
  34. }
  35. }
  36. ButtonComp.Inputs = {
  37. title: new Types.Text().require().default('Submit'),
  38. fontFamily : new Types.Text().require().default('Light'),
  39. textColor: new Types.Text().require().color().default('rgba(255, 255, 255, 1)'),
  40. backgroundColor: new Types.Text().require().color().default('rgba(73, 156, 219, 1)'),
  41. borderRadius: new Types.Integer().require().default(0),
  42. FontSize: new Types.Integer().require().default(18),
  43. width: new Types.Integer().require(),
  44. height: new Types.Integer().require()
  45. }
  46. ButtonComp.Styles = Styles;