mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 09:50:15 +01:00
REF: show numeric keyboard when ask for numbers in prompt
This commit is contained in:
parent
177730a89c
commit
056956c3fc
@ -2,6 +2,8 @@ import { Platform } from 'react-native';
|
||||
import prompt from 'react-native-prompt-android';
|
||||
|
||||
module.exports = (title, text, isCancelable = true, type = 'secure-text') => {
|
||||
const keyboardType = type === 'numeric' ? 'numeric' : 'default';
|
||||
|
||||
if (Platform.OS === 'ios' && type === 'numeric') {
|
||||
// `react-native-prompt-android` on ios does not support numeric input
|
||||
type = 'plain-text';
|
||||
@ -20,7 +22,7 @@ module.exports = (title, text, isCancelable = true, type = 'secure-text') => {
|
||||
{
|
||||
text: 'OK',
|
||||
onPress: password => {
|
||||
console.log('OK Pressed, password: ' + password);
|
||||
console.log('OK Pressed');
|
||||
resolve(password);
|
||||
},
|
||||
},
|
||||
@ -29,7 +31,7 @@ module.exports = (title, text, isCancelable = true, type = 'secure-text') => {
|
||||
{
|
||||
text: 'OK',
|
||||
onPress: password => {
|
||||
console.log('OK Pressed, password: ' + password);
|
||||
console.log('OK Pressed');
|
||||
resolve(password);
|
||||
},
|
||||
},
|
||||
@ -38,6 +40,7 @@ module.exports = (title, text, isCancelable = true, type = 'secure-text') => {
|
||||
prompt(title, text, buttons, {
|
||||
type: type,
|
||||
cancelable: isCancelable,
|
||||
keyboardType,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user