diff --git a/components/app.js b/components/app.js index 4953678..6ae3e86 100644 --- a/components/app.js +++ b/components/app.js @@ -63,7 +63,6 @@ class App extends Component { const pageProps = { cycleDay: date && getCycleDay(date), date, - handleBackButtonPress: goBack, } return ( diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index a8ae709..f0579c1 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -14,7 +14,6 @@ class Bleeding extends Component { static propTypes = { cycleDay: PropTypes.object, - handleBackButtonPress: PropTypes.func, date: PropTypes.string.isRequired, } @@ -54,7 +53,6 @@ class Bleeding extends Component { { this.deleteSymptomEntry() - this.props.handleBackButtonPress() + this.props.goBack() } showConfirmationAlert = () => { @@ -75,13 +76,13 @@ class SymptomView extends Component { } render() { - const { symptom, date } = this.props + const { symptom, date, goBack } = this.props return (
{ return({ - date: getDate(state) + date: getDate(state), + }) +} + +const mapDispatchToProps = (dispatch) => { + return({ + goBack: () => dispatch(goBack()), }) } export default connect( mapStateToProps, - null + mapDispatchToProps, )(SymptomView) diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index f735001..5c033c9 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -20,7 +20,6 @@ class Temperature extends Component { static propTypes = { cycleDay: PropTypes.object, - handleBackButtonPress: PropTypes.func, date: PropTypes.string.isRequired, } @@ -90,7 +89,6 @@ class Temperature extends Component { cycleDay: PropTypes.object, date: PropTypes.string, - handleBackButtonPress: PropTypes.func, } constructor(props) {