12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import React from 'react';
- import Module from '../../lib/Module';
- import {StyleSheet ,TextInput, View, Text } from 'react-native';
- import Types from '../../lib/Types';
- export default class TextComp extends Module {
- constructor(props) {
- super(props);
- this.state = {
- text: props.text || ""
- }
-
-
- }
- display() {
- let {
- text,
- color,
- fontSize,
- fontFamily,
- lineHeight,
- letterSpacing,
- textAlign
- } = this.props;
- return (
- <View>
- <Text style={{color, fontSize,fontFamily,textAlign, lineHeight, letterSpacing}}>
- {text}
- </Text>
- {this.props.children}
- </View>)
- }
- }
- TextComp.Inputs = {
- text: new Types.Text().default("Enter Text"),
- color: new Types.Text().require().color().default('rgba(112, 112, 112, 1)'),
- fontSize: new Types.Integer().default(22),
- fontFamily: new Types.Text(),
- lineHeight: new Types.Real(),
- letterSpacing: new Types.Real(),
- textAlign: new Types.Text()
- }
|