3
0

index.js 939 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. }
  12. display() {
  13. let {
  14. text,
  15. color,
  16. fontSize,
  17. fontFamily,
  18. lineHeight,
  19. letterSpacing,
  20. textAlign
  21. } = this.props;
  22. return (
  23. <View>
  24. <Text style={{color, fontSize,fontFamily,textAlign, lineHeight, letterSpacing}}>
  25. {text}
  26. </Text>
  27. {this.props.children}
  28. </View>)
  29. }
  30. }
  31. TextComp.Inputs = {
  32. text: new Types.Text().default("Enter Text"),
  33. color: new Types.Text().require().color().default('rgba(112, 112, 112, 1)'),
  34. fontSize: new Types.Integer().default(22),
  35. fontFamily: new Types.Text(),
  36. lineHeight: new Types.Real(),
  37. letterSpacing: new Types.Real(),
  38. textAlign: new Types.Text()
  39. }