Update Alert Dialog Box UI
This commit is contained in:
parent
54bf7fa523
commit
17782b7e4c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -50,6 +50,17 @@ class AddAccountCard extends React.PureComponent {
|
|||
}
|
||||
|
||||
submitAddAccountCard = async () => {
|
||||
const showInfoModal = (message) => {
|
||||
this.props.openModal({
|
||||
open: true,
|
||||
title: "Information",
|
||||
body: message,
|
||||
yesButtonOnly: true,
|
||||
yesText: "Okay",
|
||||
theme: this.props.app_theme
|
||||
});
|
||||
};
|
||||
|
||||
let accounts = await DB.accounts();
|
||||
let included = accounts.find((account) => {
|
||||
return account.data.card_number === this.state.cardnumber
|
||||
|
@ -83,12 +94,12 @@ class AddAccountCard extends React.PureComponent {
|
|||
});
|
||||
}, 700);
|
||||
} else {
|
||||
Alert.alert("Information", '\n' + JSON.stringify(process))
|
||||
showInfoModal(JSON.stringify(process));
|
||||
}
|
||||
},
|
||||
theme: this.props.app_theme
|
||||
})
|
||||
}, 300) : Alert.alert("Information", '\n' + res.message)
|
||||
}, 300) : showInfoModal(res.message);
|
||||
} else {
|
||||
this.setState({ loading: true })
|
||||
this.validateCard(success => {
|
||||
|
@ -109,17 +120,17 @@ class AddAccountCard extends React.PureComponent {
|
|||
})
|
||||
}
|
||||
}, err => {
|
||||
Alert.alert("Information", `\n${err.message}`);
|
||||
showInfoModal(err.message);
|
||||
this.setState({ loading: false })
|
||||
})
|
||||
} else {
|
||||
this.setState({ loading: false })
|
||||
Platform.OS == 'ios' ? setTimeout(() => {
|
||||
Alert.alert("Information", '\n' + success.message)
|
||||
}, 300) : Alert.alert("Information", '\n' + success.message)
|
||||
showInfoModal(success.message);
|
||||
}, 300) : showInfoModal(success.message);
|
||||
}
|
||||
}, err => {
|
||||
Alert.alert("Information", `\n${err.message}`);
|
||||
showInfoModal(err.message);
|
||||
this.setState({ loading: false })
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue