diff --git a/components/cycle-day/symptoms/action-button-footer.js b/components/cycle-day/symptoms/action-button-footer.js
index dac39a6..ea96f94 100644
--- a/components/cycle-day/symptoms/action-button-footer.js
+++ b/components/cycle-day/symptoms/action-button-footer.js
@@ -3,13 +3,11 @@ import {
View, TouchableOpacity, Text
} from 'react-native'
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
-import { saveSymptom } from '../../../db'
import styles, {iconStyles} from '../../../styles'
export default class ActionButtonFooter extends Component {
render() {
const {
- symptom,
cycleDay,
saveAction,
saveDisabled,
@@ -17,53 +15,33 @@ export default class ActionButtonFooter extends Component {
autoShowDayView = true}
= this.props
const navigateToOverView = () => navigate('CycleDay', {cycleDay})
- const buttons = [
- {
- title: 'Cancel',
- action: () => navigateToOverView(),
- icon: 'cancel'
+ const saveButton = {
+ title: 'Save',
+ action: () => {
+ saveAction()
+ if (autoShowDayView) navigateToOverView()
},
- {
- title: 'Delete',
- action: () => {
- saveSymptom(symptom, cycleDay)
- navigateToOverView()
- },
- disabledCondition: !cycleDay[symptom],
- icon: 'delete-outline'
- }, {
- title: 'Save',
- action: () => {
- saveAction()
- if (autoShowDayView) navigateToOverView()
- },
- disabledCondition: saveDisabled,
- icon: 'content-save-outline'
- }
- ]
+ disabledCondition: saveDisabled,
+ icon: 'content-save-outline'
+ }
+ const textStyle = saveButton.disabledCondition ? styles.menuTextInActive : styles.menuText
+ const iconStyle = saveButton.disabledCondition ?
+ Object.assign({}, iconStyles.menuIcon, iconStyles.menuIconInactive) :
+ iconStyles.menuIcon
return (
- {buttons.map(({ title, action, disabledCondition, icon }, i) => {
- const textStyle = disabledCondition ? styles.menuTextInActive : styles.menuText
- const iconStyle = disabledCondition ?
- Object.assign({}, iconStyles.menuIcon, iconStyles.menuIconInactive) :
- iconStyles.menuIcon
-
- return (
-
-
-
- {title}
-
-
- )
- })}
+
+
+
+ {saveButton.title}
+
+
)
}
diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js
index 3c88ec5..6357c26 100644
--- a/components/cycle-day/symptoms/bleeding.js
+++ b/components/cycle-day/symptoms/bleeding.js
@@ -56,7 +56,6 @@ export default class Bleeding extends Component {
{
saveSymptom('bleeding', this.props.cycleDay, {