diff options
| author | mo khan <mo@mokhan.ca> | 2017-01-14 15:24:00 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2017-01-14 15:24:00 -0700 |
| commit | ff3e3acca888554f1aca390485e5859b7c11145c (patch) | |
| tree | f492148df7d4c3a21ddabbcf02030489db557a91 | |
| parent | 0ac4a0e5dea2086e10228146faefb9cae77b3ebf (diff) | |
fix up the new workout screen.
| -rw-r--r-- | app/presentation/screens/new-workout-screen.js | 8 | ||||
| -rw-r--r-- | app/services/commands/create-workout-command.js | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/app/presentation/screens/new-workout-screen.js b/app/presentation/screens/new-workout-screen.js index 48d4f4d..5eb8ae1 100644 --- a/app/presentation/screens/new-workout-screen.js +++ b/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> ); } diff --git a/app/services/commands/create-workout-command.js b/app/services/commands/create-workout-command.js index 73b7b07..b9026e9 100644 --- a/app/services/commands/create-workout-command.js +++ b/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"}, |
