diff --git a/components/cycle-day/symptoms/action-button-footer.js b/components/cycle-day/symptoms/action-button-footer.js index 076b0bb..7f0bb5f 100644 --- a/components/cycle-day/symptoms/action-button-footer.js +++ b/components/cycle-day/symptoms/action-button-footer.js @@ -1,12 +1,13 @@ import React, { Component } from 'react' import { - View, TouchableOpacity, Text, Alert + View, TouchableOpacity, Text, Alert, ToastAndroid } from 'react-native' import Icon from 'react-native-vector-icons/MaterialCommunityIcons' import { saveSymptom } from '../../../db' import styles, {iconStyles} from '../../../styles' import {sharedDialogs as labels} from '../../../i18n/en/cycle-day' + export default class ActionButtonFooter extends Component { render() { const { @@ -43,19 +44,28 @@ export default class ActionButtonFooter extends Component { }, { title: labels.save, action: () => { - saveAction() - if (autoShowDayView) navigateToOverView() + if(saveDisabled) { + //toast + ToastAndroid.show(labels.disabledInfo, ToastAndroid.LONG); + console.log() + } else { + saveAction() + if (autoShowDayView) navigateToOverView() + } + }, disabledCondition: saveDisabled, icon: 'content-save-outline' } ] - + console.log("Hello beautiful people") return ( {buttons.map(({ title, action, disabledCondition, icon }, i) => { const textStyle = [styles.menuText] - if (disabledCondition) textStyle.push(styles.menuTextInActive) + if (disabledCondition) { + textStyle.push(styles.menuTextInActive); + } const iconStyle = disabledCondition ? Object.assign( {}, @@ -68,7 +78,6 @@ export default class ActionButtonFooter extends Component { @@ -76,9 +85,10 @@ export default class ActionButtonFooter extends Component { {title.toLowerCase()} + ) })} ) } -} \ No newline at end of file +} diff --git a/i18n/en/cycle-day.js b/i18n/en/cycle-day.js index ff7ed56..78cd4e2 100644 --- a/i18n/en/cycle-day.js +++ b/i18n/en/cycle-day.js @@ -92,5 +92,6 @@ export const sharedDialogs = { areYouSureToUnset: 'Are you sure you want to unset all entered data?', reallyUnsetData: 'Yes, I am sure', save: 'Save', - unset: 'Unset' + unset: 'Unset', + disabledInfo: 'There is some data missing' }