Programmatically add props to cycle day views

This commit is contained in:
Julia Friesel
2018-08-02 09:47:21 +02:00
parent e51a99b8af
commit 310683c5f8
4 changed files with 49 additions and 28 deletions
+5 -3
View File
@@ -5,24 +5,26 @@ import {
} from 'react-native'
import { saveSymptom } from '../../db'
const dayView = 'DayView'
export default function (showView) {
return function ({ symptom, cycleDay, saveAction, saveDisabled}) {
const buttons = [
{
title: 'Cancel',
action: () => showView('dayView')
action: () => showView(dayView)
},
{
title: 'Delete',
action: () => {
saveSymptom(symptom, cycleDay)
showView('dayView')
showView(dayView)
}
}, {
title: 'Save',
action: () => {
saveAction()
showView('dayView')
showView(dayView)
},
disabledCondition: saveDisabled
}