LabelLinkView.js 1.01 KB
import React, {Component} from 'react';
import {
    View,
    Text,
    TouchableOpacity
} from 'react-native';

export default class LabelLinkView extends Component {

    constructor(props) {
        super(props);
        this.state = {}

        this.attrData = this.props.attrData;
    }

    render() {
        let {name, code, type, uom, description, isRequired, isPreview} = this.attrData;
        let {placeholder, hyperlink} = JSON.parse(this.attrData.data);
        return (
            <TouchableOpacity
                style={{width: '100%', backgroundColor: 'rgba(245, 245, 245, 1)', flexDirection: 'row', paddingHorizontal: 5, paddingVertical: 10}}
                activeOpacity={0.8}
                onPress={()=>{}}
            >
                {isRequired&&<Text style={{ color: "#FF3030" }}>* {" "}</Text>}
                {!isRequired&&<Text style={{ color: "#fff" }}>* {" "}</Text>}
                <Text style={{fontSize: 14, color: '#999'}}>{placeholder}</Text>
            </TouchableOpacity>
        );
    }
}