diff --git a/components/cycle-day/symptoms/action-button-footer.js b/components/cycle-day/symptoms/action-button-footer.js deleted file mode 100644 index 5dea8ac..0000000 --- a/components/cycle-day/symptoms/action-button-footer.js +++ /dev/null @@ -1,48 +0,0 @@ -import React, { Component } from 'react' -import { - View, TouchableOpacity, Text} from 'react-native' -import Icon from 'react-native-vector-icons/MaterialCommunityIcons' -import styles, {iconStyles} from '../../../styles' -import {sharedDialogs as labels} from '../../../i18n/en/cycle-day' - - -export default class ActionButtonFooter extends Component { - render() { - const { - currentSymptomValue, - } - = this.props - const buttons = [ - { - title: labels.delete, - action: () => { - }, - disabledCondition: (!currentSymptomValue || - (Object.keys(currentSymptomValue).length === 0 && currentSymptomValue.constructor === Object) || - (Object.values(currentSymptomValue).every(x => !x) && currentSymptomValue.constructor === Object) - ), - icon: 'delete-outline' - } - ] - return ( - - {buttons.map(({ title, action, icon }, i) => { - const textStyle = [styles.menuText] - return ( - - - - {title.toLowerCase()} - - - - ) - })} - - ) - } -} diff --git a/components/cycle-day/symptoms/symptom-view.js b/components/cycle-day/symptoms/symptom-view.js index abcd758..9c58599 100644 --- a/components/cycle-day/symptoms/symptom-view.js +++ b/components/cycle-day/symptoms/symptom-view.js @@ -41,6 +41,10 @@ export default class SymptomView extends Component { title={headerTitles[this.symptomName].toLowerCase()} date={this.date} goBack={this.handleBackButtonPressOnSymptomView.bind(this)} + deleteIconActive={Object.values(this.state).some(x => { + // is there any meaningful value in the current state? + return x || x === 0 + })} deleteEntry={() => { Alert.alert( sharedDialogs.areYouSureTitle, diff --git a/components/header/symptom-view.js b/components/header/symptom-view.js index 7cdbc3f..d3df585 100644 --- a/components/header/symptom-view.js +++ b/components/header/symptom-view.js @@ -32,11 +32,12 @@ export default function SymptomViewHeader(props) {