ContainerView.js
1.29 KB
import React, {Component} from 'react';
import {
View,
Text,
} from "react-native";
import {getTextAlignVerticalStyle} from "../utils/Common";
const defaultHeight = (30);
const HPading = (16);
const VPading = (6);
/**
* 布局容器
*/
export default class ContainerView extends Component {
constructor(props) {
super(props);
this.state = {}
this.attrData = this.props.attrData;
this.onDeleterListener = this.props.onDeleterListener;
}
render() {
let {name, code, type, description, isRequired, isPreview} = this.attrData;
let {showSplitLine} = JSON.parse(this.attrData.data);
return (
<View style={{width: '100%',paddingTop: VPading, paddingLeft:20,height:defaultHeight, backgroundColor: '#fff'}}>
<View style={{flexDirection: 'row',justifyContent:'flex-start',alignItems: 'center'}}>
{showSplitLine && <View style={{height:1,width: 20,backgroundColor:'#eee'}}></View>}
<Text style={[{fontSize: 14, color: 'rgb(51,51,51)',marginHorizontal:4},getTextAlignVerticalStyle(defaultHeight)]}>{name||''}</Text>
{showSplitLine && <View style={{height:1,flex:1,backgroundColor:'#eee'}}></View>}
</View>
</View>
);
}
}