diff --git a/components/cycle-day/action-buttons.js b/components/cycle-day/action-buttons.js index 78e2479337a31f44277cc11a8260cd7e89150001..488b10dc76436dd896c2ee03368218f22310c77f 100644 --- a/components/cycle-day/action-buttons.js +++ b/components/cycle-day/action-buttons.js @@ -5,26 +5,24 @@ import { } from 'react-native' import { saveSymptom } from '../../db' -const dayView = 'DayView' - -export default function (showView) { +export default function (navigateToOverView) { return function ({ symptom, cycleDay, saveAction, saveDisabled}) { const buttons = [ { title: 'Cancel', - action: () => showView(dayView) + action: () => navigateToOverView() }, { title: 'Delete', action: () => { saveSymptom(symptom, cycleDay) - showView(dayView) + navigateToOverView() } }, { title: 'Save', action: () => { saveAction() - showView(dayView) + navigateToOverView() }, disabledCondition: saveDisabled } diff --git a/components/cycle-day/symptoms/index.js b/components/cycle-day/symptoms/index.js index c2c050b62c923eba8012eb5dc54735a499182396..5b73d857ca87914c15e4bbea99b753bbf8eac9a7 100644 --- a/components/cycle-day/symptoms/index.js +++ b/components/cycle-day/symptoms/index.js @@ -38,10 +38,9 @@ export default class SymptomView extends Component { cycleDay: props.navigation.state.params.cycleDay } - this.showView = view => { - this.setState({visibleComponent: view}) - } - this.makeActionButtons = actionButtonModule(this.showView) + this.makeActionButtons = actionButtonModule(() => { + this.props.navigation.navigate('CycleDay', {cycleDay: this.state.cycleDay}) + }) } render() {