Ask before deleting entry
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import React, { Component } from 'react'
|
||||
import { BackHandler, View } from 'react-native'
|
||||
import { BackHandler, View, Alert } from 'react-native'
|
||||
import { saveSymptom } from '../../../db'
|
||||
import Header from '../../header/symptom-view'
|
||||
import { headerTitles } from '../../../i18n/en/labels'
|
||||
import { sharedDialogs } from '../../../i18n/en/cycle-day'
|
||||
|
||||
export default class SymptomView extends Component {
|
||||
constructor(props) {
|
||||
@@ -41,8 +42,20 @@ export default class SymptomView extends Component {
|
||||
date={this.date}
|
||||
goBack={this.handleBackButtonPressOnSymptomView.bind(this)}
|
||||
deleteEntry={() => {
|
||||
this.deleteSymptomEntry()
|
||||
this.globalBackhandler()
|
||||
Alert.alert(
|
||||
sharedDialogs.areYouSureTitle,
|
||||
sharedDialogs.areYouSureToDelete,
|
||||
[{
|
||||
text: sharedDialogs.cancel,
|
||||
style: 'cancel'
|
||||
}, {
|
||||
text: sharedDialogs.reallyDeleteData,
|
||||
onPress: () => {
|
||||
this.deleteSymptomEntry()
|
||||
this.globalBackhandler()
|
||||
}
|
||||
}]
|
||||
)
|
||||
}}
|
||||
/>
|
||||
{this.renderContent()}
|
||||
|
||||
Reference in New Issue
Block a user