added some placeholder functions / code.

mostly learning what I can do with React-Native.
This commit is contained in:
lesmaux
2018-09-11 10:21:19 +12:00
parent fc66cbc648
commit 4353681184
3 changed files with 105 additions and 27 deletions
+15 -3
View File
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import sharedStyles from '../shared-styles';
import {
Platform,
StyleSheet,
@@ -7,11 +8,22 @@ import {
} from 'react-native';
export default class RunInfo extends Component {
constructor(props) {
super(props);
this.state = { value: this.props.value};
}
formatValue() {
return this.state.value;
}
render() {
let value = this.state.value ? this.formatValue() : '-';
return (
<View>
<Text>{this.props.title}</Text>
<Text>{this.props.value}</Text>
<View style ={[sharedStyles.runInfoWrapper, {flex: 1}]}>
<Text style ={sharedStyles.runInfoValue}>{value}</Text>
<Text style={sharedStyles.runInfoTitle}>{this.props.title}</Text>
</View>
)
}