BlueWallet/prompt.js
Igor Korsakov 65be52ed3d
Development (#96)
* ADD: Wallet Details screen
* FIX: Fixed receive and send calls
* FIX: improve splash image and colors
* FIX: Modified Encrypted Storage prompt to avoid cancellation
* FIX: improved tx refresh strategy
* FIX: HDBread tx confirmations calculation
2018-10-09 00:25:36 -04:00

35 lines
850 B
JavaScript

import { AlertIOS } from 'react-native';
module.exports = (title, text, isCancelable = true) => {
return new Promise((resolve, reject) => {
const buttons = isCancelable
? [
{
text: 'Cancel',
onPress: () => {
reject(Error('Cancel Pressed'));
},
style: 'cancel',
},
{
text: 'OK',
onPress: password => {
console.log('OK Pressed, password: ' + password);
resolve(password);
},
},
]
: [
{
text: 'OK',
onPress: password => {
console.log('OK Pressed, password: ' + password);
resolve(password);
},
},
];
AlertIOS.prompt(title, text, buttons, 'secure-text');
});
};