Commit ff3e3ac

mo khan <mo@mokhan.ca>
2017-01-14 22:24:00
fix up the new workout screen.
1 parent 0ac4a0e
Changed files (2)
app
presentation
services
app/presentation/screens/new-workout-screen.js
@@ -29,11 +29,7 @@ export default class NewWorkoutScreen extends Screen {
             <Title>Routine {this.state.routine.name}</Title>
           </Header>
           <Content>
-            <Button large block iconRight onPress={this.onBeginWorkout.bind(this)}>
-              Begin
-              <Icon name='ios-arrow-forward' />
-            </Button>
-            <Text>Body Weight: {this.state.body_weight.amount} {this.state.body_weight.unit}</Text>
+            <Text style={{textAlign: 'center'}}>Body Weight: {this.state.body_weight.amount} {this.state.body_weight.unit}</Text>
             <List dataArray={this.state.exercises} renderRow={this.renderExercise.bind(this)}></List>
             <Button large block iconRight onPress={this.onBeginWorkout.bind(this)}>
               Begin
@@ -58,7 +54,7 @@ export default class NewWorkoutScreen extends Screen {
 
   renderRow(set) {
     return (
-      <ListItem button><Text>{set.target_weight.amount} {set.target_weight.unit}</Text></ListItem>
+      <ListItem button><Text>{set.target_repetitions} repetitions @ {set.target_weight.amount} {set.target_weight.unit} </Text></ListItem>
     );
   }
 
app/services/commands/create-workout-command.js
@@ -22,7 +22,7 @@ export default class CreateWorkoutCommand extends ApplicationCommand {
       }
     };
     if (this.configuration.isEnabled('LOCAL_ONLY')) {
-      this.onResponse(this.exampleResponse());
+      this.onResponse(this.exampleResponseFor(body));
     } else {
       this.api.post('/workouts', body, this.onResponse.bind(this));
     }
@@ -35,10 +35,10 @@ export default class CreateWorkoutCommand extends ApplicationCommand {
     });
   }
 
-  exampleResponse() {
+  exampleResponseFor(body) {
     return {
-      "body_weight":{"amount":237.0,"unit":"lbs"},
-      "routine":{"id":"493263ce-6b60-456f-8645-f2c3f0e0f820","name":"B"},
+      "body_weight":{"amount":body.workout.body_weight,"unit":"lbs"},
+      "routine":{"id":body.workout.routine_id,"name":"B"},
       "exercises":[
         {"id":"7d91de12-60f6-4a04-9ed4-a9bbeb05681b","name":"Squat"},
         {"id":"98900216-dc06-474b-9f65-d72509aab218","name":"Overhead Press"},