3
0

index.js 911 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React from 'react';
  2. import Module from '../../lib/Module';
  3. import {StyleSheet ,TextInput, View, Text } from 'react-native';
  4. import Types from '../../lib/Types';
  5. export default class TextComp extends Module {
  6. constructor(props) {
  7. super(props);
  8. this.state = {
  9. text: props.text || ""
  10. }
  11. console.log("Look at me now")
  12. console.log(this)
  13. if(this.props.CoreSystem){
  14. //console.log(this.props.CoreSystem.ViewSystem.getChildren(this))
  15. }
  16. }
  17. display() {
  18. let {
  19. text,
  20. color,
  21. fontSize,
  22. fontFamily,
  23. textAlign
  24. } = this.props;
  25. return (
  26. <View>
  27. <Text style={{color, fontSize,fontFamily,textAlign}}>
  28. {text}
  29. </Text>
  30. {this.props.children}
  31. </View>)
  32. }
  33. }
  34. TextComp.Inputs = {
  35. text: new Types.Text().default("Enter Text"),
  36. color: new Types.Text(),
  37. fontSize: new Types.Integer().default(22),
  38. fontFamily: new Types.Text(),
  39. textAlign: new Types.Text()
  40. }