Skip to content

Commit

Permalink
Fix for 16821
Browse files Browse the repository at this point in the history
  • Loading branch information
milciunas committed Dec 27, 2017
1 parent fe3a658 commit 015a690
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 23 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"moment": "^2.20.1",
"react": "16.0.0",
"react-native": "0.50.3",
"react-native-calendar-strip": "^1.3.0",
"react-native-flex-image": "^1.1.0",
"react-native-router-flux": "^4.0.0-beta.24",
"react-redux": "^5.0.6",
Expand Down
4 changes: 2 additions & 2 deletions src/components/ExerciseDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ExerciseDetails extends Component {
}

render() {
const { image_end, image_start, muscle, name, sets_x_reps, type } = this.props.details;
const { image_end, image_start, muscle, name, sets_x_reps } = this.props.details;

return (
<View style={styles.screen}>
Expand All @@ -45,7 +45,7 @@ class ExerciseDetails extends Component {
</View>
<View style={styles.splitter} />
<View style={styles.textContainer}>
<Text style={{ textAlign: 'center' }}>{'Sets x Repetitions: '}</Text>
<Text style={{ textAlign: 'center' }}>{'Sets and Repetitions: '}</Text>
<Text style={{ fontWeight: '700' }}>{sets_x_reps}</Text>
</View>
<View style={styles.splitter} />
Expand Down
29 changes: 26 additions & 3 deletions src/screens/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,37 @@ class HomeScreen extends Component {
loading: PropTypes.bool
}

constructor() {
super();

this.state = {
shouldRender: false
};
}

componentDidMount() {
setTimeout(() => {
this.setState({
shouldRender: true
});
}, 3000);
}

render() {
console.log('HOME props ', this.props);
console.log('HOME props ', this.props.loading);
if (this.props.loading) {
if (this.props.loading && !this.state.shouldRender) {
return <ActivityIndicator
style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}
style={styles.loadingIncidator}
size='large'
color='#2196F3' />;
}

return (
<View style={styles.screen}>
<ScrollView contentContainerStyle={styles.container}>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={styles.container}>
<Exercises exercises={this.props.exercises}/>
</ScrollView>
</View>
Expand All @@ -50,5 +68,10 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
padding: 10
},
loadingIncidator: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
});
8 changes: 4 additions & 4 deletions src/state/sagas/workoutSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ export function calculateWorkoutSize(workout, details) {
if (exercise) {
if (details.level.toLowerCase() === 'beginner') {
if (details.goal === 'gain') {
exercise['sets_x_reps'] = gain.beginner.reps + 'x' + gain.beginner.sets;
exercise['sets_x_reps'] = gain.beginner.sets + 'x' + gain.beginner.reps;
} else {
exercise['sets_x_reps'] = loss.beginner.reps + 'x' + loss.beginner.sets;
exercise['sets_x_reps'] = loss.beginner.sets + 'x' + loss.beginner.reps;
}
} else {
if (details.goal === 'gain') {
exercise['sets_x_reps'] = gain.intermediate.reps + 'x' + gain.intermediate.sets;
exercise['sets_x_reps'] = gain.intermediate.sets + 'x' + gain.intermediate.reps;
} else {
exercise['sets_x_reps'] = loss.intermediate.reps + 'x' + loss.intermediate.sets;
exercise['sets_x_reps'] = loss.intermediate.sets + 'x' + loss.intermediate.reps;
}
}

Expand Down
41 changes: 27 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,15 @@ babel-core@^6.0.0, babel-core@^6.24.1, babel-core@^6.26.0, babel-core@^6.7.2:
source-map "^0.5.6"

babel-eslint@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.0.3.tgz#f29ecf02336be438195325cd47c468da81ee4e98"
version "8.1.2"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.1.2.tgz#a39230b0c20ecbaa19a35d5633bf9b9ca2c8116f"
dependencies:
"@babel/code-frame" "7.0.0-beta.31"
"@babel/traverse" "7.0.0-beta.31"
"@babel/types" "7.0.0-beta.31"
babylon "7.0.0-beta.31"
eslint-scope "~3.7.1"
eslint-visitor-keys "^1.0.0"

babel-generator@^6.18.0, babel-generator@^6.24.1, babel-generator@^6.26.0:
version "6.26.0"
Expand Down Expand Up @@ -2114,8 +2116,8 @@ es6-error@^4.0.2:
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98"

es6-promise@^4.0.3:
version "4.2.1"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.1.tgz#3b98a6714ba1b9267428b2c00e6265b16dab0205"
version "4.2.2"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.2.tgz#f722d7769af88bd33bc13ec6605e1f92966b82d9"

es6-promisify@^5.0.0:
version "5.0.0"
Expand Down Expand Up @@ -2188,28 +2190,32 @@ eslint-plugin-react@^7.5.1:
jsx-ast-utils "^2.0.0"
prop-types "^15.6.0"

eslint-scope@^3.7.1:
eslint-scope@^3.7.1, eslint-scope@~3.7.1:
version "3.7.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
dependencies:
esrecurse "^4.1.0"
estraverse "^4.1.1"

eslint-visitor-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"

eslint@^4.12.1:
version "4.13.1"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.1.tgz#0055e0014464c7eb7878caf549ef2941992b444f"
version "4.14.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.14.0.tgz#96609768d1dd23304faba2d94b7fefe5a5447a82"
dependencies:
ajv "^5.3.0"
babel-code-frame "^6.22.0"
chalk "^2.1.0"
concat-stream "^1.6.0"
cross-spawn "^5.1.0"
debug "^3.0.1"
debug "^3.1.0"
doctrine "^2.0.2"
eslint-scope "^3.7.1"
eslint-visitor-keys "^1.0.0"
espree "^3.5.2"
esquery "^1.0.0"
estraverse "^4.2.0"
esutils "^2.0.2"
file-entry-cache "^2.0.0"
functional-red-black-tree "^1.0.1"
Expand Down Expand Up @@ -4394,7 +4400,7 @@ mobx@^3.3.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-3.4.1.tgz#37abe5ee882d401828d9f26c6c1a2f47614bbbef"

moment@2.x.x, moment@^2.10.6, moment@^2.20.1:
moment@2.x.x, moment@^2.10.6, moment@^2.17.1, moment@^2.20.1:
version "2.20.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd"

Expand Down Expand Up @@ -5163,6 +5169,13 @@ react-native-branch@2.0.0-beta.3:
version "2.0.0-beta.3"
resolved "https://registry.yarnpkg.com/react-native-branch/-/react-native-branch-2.0.0-beta.3.tgz#2167af86bbc9f964bd45bd5f37684e5b54965e32"

react-native-calendar-strip@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/react-native-calendar-strip/-/react-native-calendar-strip-1.3.0.tgz#bf845f56acd7afa06dcae04999a2a1f4eb23cc06"
dependencies:
moment "^2.17.1"
prop-types "^15.6.0"

react-native-dismiss-keyboard@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/react-native-dismiss-keyboard/-/react-native-dismiss-keyboard-1.0.0.tgz#32886242b3f2317e121f3aeb9b0a585e2b879b49"
Expand Down Expand Up @@ -5905,8 +5918,8 @@ slugid@^1.1.0:
uuid "^2.0.1"

slugify@^1.0.2:
version "1.2.7"
resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.2.7.tgz#49998fa5f26e001ca366298937ad25fb6e9742cf"
version "1.2.8"
resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.2.8.tgz#f74581b0376d1ccec9a4abfaf06c7aaa9737caef"

smart-buffer@^1.0.13:
version "1.1.15"
Expand Down Expand Up @@ -6397,8 +6410,8 @@ ua-parser-js@^0.7.9:
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"

uglify-es@^3.1.8:
version "3.2.2"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.2.2.tgz#15c62b7775002c81b7987a1c49ecd3f126cace73"
version "3.3.2"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.2.tgz#2401df8be2a433314523753f28810793a40c5462"
dependencies:
commander "~2.12.1"
source-map "~0.6.1"
Expand Down

0 comments on commit 015a690

Please sign in to comment.