From 3e72bfa56c860826429a842f6c128d78d4a930db Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 1 Jun 2017 19:47:08 -0400 Subject: react-native-web port of fmf app --- client/src/lib/components/definition.js | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 client/src/lib/components/definition.js (limited to 'client/src/lib/components/definition.js') diff --git a/client/src/lib/components/definition.js b/client/src/lib/components/definition.js new file mode 100644 index 0000000..b6b78f5 --- /dev/null +++ b/client/src/lib/components/definition.js @@ -0,0 +1,52 @@ +import React, { Component } from 'react'; +import { + StyleSheet, + View, +} from 'react-native'; + +import ClearText from './text' + +export default class Definition extends Component { + render() { + let { labelStyle, contentStyle, label, children, contentIsView, ...others } = this.props + let content; + if (contentIsView) { + content = ( + {children} + ) + } + else { + content = ( + {children} + ) + } + return ( + + {label} + {content} + + ) + } +} + +const styles = StyleSheet.create({ + item: { + justifyContent: 'flex-start', + flexDirection: 'row', + width: '100%', + paddingBottom: 0, + }, + label: { + width: 80, + minWidth: 80, + textAlign: 'left', + color: '#bbb', + }, + content: { + flex: 1, + textAlign: 'left' + }, + contentView: { + flex: 1, + }, +}) -- cgit v1.2.3-70-g09d2