Commit c47a242

mo khan <mo@mokhan.ca>
2016-12-04 21:46:22
render routine and body weight.
1 parent 972d5c1
Changed files (2)
app
app/components/workout.js
@@ -4,7 +4,10 @@ import { View, Text } from 'react-native';
 export default class Workout extends Component {
   render() {
     return (
-      <Text style={{flex: 1}}>{this.props.name}</Text>
+      <View style={{flex: 1}}>
+        <Text>{this.props.routine_name}</Text>
+        <Text>{this.props.body_weight.amount}</Text>
+      </View>
     )
   }
 }
app/screens/dashboard-screen.js
@@ -23,7 +23,7 @@ export default class DashboardScreen extends ApplicationComponent {
         <Button onPress={this.onStartWorkout.bind(this)} title="Start Workout" />
         <ListView
           dataSource={this.state.dataSource}
-          renderRow={(row) => <Workout name={row} />}
+          renderRow={(row) => <Workout {...row} />}
           />
         <Button onPress={this.onLogout.bind(this)} title="Logout" />
       </View>
@@ -57,6 +57,6 @@ export default class DashboardScreen extends ApplicationComponent {
   }
 
   mapAll(workouts) {
-    return this.ds.cloneWithRows(workouts.map((item) => item.routine_name));
+    return this.ds.cloneWithRows(workouts);
   }
 }