BlueWallet/prompt.js
Marcos Rodriguez Vélez 6637d2d380 Fixes
2018-09-19 01:11:39 +01:00

28 lines
563 B
JavaScript

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