added some placeholder functions / code.
mostly learning what I can do with React-Native.
This commit is contained in:
+15
-3
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user