Moves navigation to the state
This commit is contained in:
@@ -3,6 +3,7 @@ import { ScrollView, View } from 'react-native'
|
||||
|
||||
import { connect } from 'react-redux'
|
||||
import { getDate, setDate } from '../../slices/date'
|
||||
import { navigate } from '../../slices/navigation'
|
||||
|
||||
import { LocalDate } from 'js-joda'
|
||||
import Header from '../header'
|
||||
@@ -41,11 +42,6 @@ class CycleDayOverView extends Component {
|
||||
this.updateCycleDay(nextDate)
|
||||
}
|
||||
|
||||
navigate(symptom) {
|
||||
const { cycleDay } = this.state
|
||||
this.props.navigate(symptom, cycleDay)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { cycleDay } = this.state
|
||||
const { date } = this.props
|
||||
@@ -89,7 +85,7 @@ class CycleDayOverView extends Component {
|
||||
key={symptom}
|
||||
symptom={symptom}
|
||||
symptomData={symptomData}
|
||||
onPress={() => this.navigate(symptomEditView, symptomData)}
|
||||
onPress={() => this.props.navigate(symptomEditView)}
|
||||
disabled={dateInFuture}
|
||||
/>)
|
||||
})
|
||||
@@ -115,6 +111,7 @@ const mapStateToProps = (state) => {
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return({
|
||||
setDate: (date) => dispatch(setDate(date)),
|
||||
navigate: (page) => dispatch(navigate(page)),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user