1234567891011121314151617181920212223242526272829303132333435363738 |
- 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 {
- color,
- fontSize
- } = this.props;
- return (
- <View>
- <TextInput
- style={{color, fontSize}]}
- onChangeText={(text) => this.setState({
- text
- })}
- value={this.state.text || 'Default Text'}/>
-
- {this.props.children}
-
- </View>)
- }
- }
- TextComp.Inputs = {
- color: new Types.Text(),
- fontSize: new Types.Integer().default(22)
- }
|