diff --git a/BlueComponents.js b/BlueComponents.js index 62e510812..cfcd0bc33 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -137,7 +137,7 @@ export class BlueButtonLink extends Component { borderColor: 'transparent', }} buttonStyle={{ - height: 25, + height: 45, width: width / 1.5, }} backgroundColor="transparent" diff --git a/MainBottomTabs.js b/MainBottomTabs.js index e4238aaf5..aec0c093f 100644 --- a/MainBottomTabs.js +++ b/MainBottomTabs.js @@ -1,4 +1,4 @@ -import { createBottomTabNavigator } from 'react-navigation'; +import { createStackNavigator } from 'react-navigation'; import transactions from './screen/transactions'; import wallets from './screen/wallets'; @@ -9,43 +9,33 @@ import receive from './screen/receive'; /** @type {AppStorage} */ let BlueApp = require('./BlueApp'); -const Tabs = createBottomTabNavigator( - { - Wallets: { - screen: wallets, - path: 'wallets', - }, - Transactions: { - screen: transactions, - path: 'trans', - }, - Send: { - screen: send, - path: 'cart', - }, - Receive: { - screen: receive, - path: 'receive', - }, - Settings: { - screen: settings, - path: 'settings', - }, - - // - }, - { - tabBarPosition: 'bottom', - animationEnabled: true, - tabBarVisible: false, - tabBarOptions: { - showLabel: false, - activeTintColor: BlueApp.settings.foregroundColor, - activeBackgroundColor: '#33bdf1', - inactiveBackgroundColor: BlueApp.settings.brandingColor, - inactiveTintColor: BlueApp.settings.foregroundColor, +const Tabs = createStackNavigator({ + Wallets: { + screen: wallets, + path: 'wallets', + navigationOptions: { + title: 'Wallets', }, }, -); + Transactions: { + screen: transactions, + path: 'trans', + }, + Send: { + screen: send, + path: 'cart', + }, + Receive: { + screen: receive, + path: 'receive', + }, + Settings: { + screen: settings, + path: 'settings', + }, +}, +{ + headerMode: 'none' +}); export default Tabs; diff --git a/package-lock.json b/package-lock.json index 25842d512..52dcc4dc2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12515,12 +12515,12 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "node-fetch": { "version": "1.6.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", + "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", "integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=", "requires": { "encoding": "^0.1.11", @@ -13716,9 +13716,9 @@ } }, "react-native-elements": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/react-native-elements/-/react-native-elements-0.18.5.tgz", - "integrity": "sha1-nZpYQ5X+pj+MrXkE+yHB6sfMY88=", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/react-native-elements/-/react-native-elements-0.19.1.tgz", + "integrity": "sha1-+Stp2GShUCFdAfgf48UqnK2oPkU=", "requires": { "lodash.isempty": "^4.4.0", "lodash.times": "^4.3.2", diff --git a/package.json b/package.json index 7223ce20e..1f4499759 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "react-localization": "^1.0.10", "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz", "react-native-camera": "^0.12.0", - "react-native-elements": "^0.18.5", + "react-native-elements": "^0.19.0", "react-native-flexi-radio-button": "^0.2.2", "react-native-level-fs": "^3.0.0", "react-native-material-dropdown": "^0.11.1", diff --git a/prompt.js b/prompt.js index 4d7e5e518..85eb65c1e 100644 --- a/prompt.js +++ b/prompt.js @@ -1,11 +1,18 @@ import { AlertIOS } from 'react-native'; -module.exports = function(title, text) { - return new Promise(function(resolve, reject) { +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 => { diff --git a/screen/send/scanQrAddress.js b/screen/send/scanQrAddress.js index f8b76bf11..938455290 100644 --- a/screen/send/scanQrAddress.js +++ b/screen/send/scanQrAddress.js @@ -1,7 +1,7 @@ /* global alert */ import React from 'react'; import { Text, ActivityIndicator, Button, View, TouchableOpacity } from 'react-native'; -import { Camera, Permissions } from 'expo'; +import { Camera, Permissions, BarCodeScanner } from 'expo'; import PropTypes from 'prop-types'; let EV = require('../../events'); @@ -28,13 +28,14 @@ export default class CameraExample extends React.Component { } // end async componentWillMount() { + console.warn('here') const { status } = await Permissions.askAsync(Permissions.CAMERA); this.setState({ hasCameraPermission: status === 'granted', onCameraReady: function() { alert('onCameraReady'); }, - barCodeTypes: [Camera.Constants.BarCodeType.qr], + barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr], }); } diff --git a/screen/settings.js b/screen/settings.js index fe302238e..89cb6e2f8 100644 --- a/screen/settings.js +++ b/screen/settings.js @@ -63,12 +63,18 @@ export default class Settings extends Component { }} onPress={async () => { this.setState({ isLoading: true }); - let p1 = await prompt(loc.settings.password, loc.settings.password_explain); + let p1 = await prompt(loc.settings.password, loc.settings.password_explain).catch(() => { + this.setState({ isLoading: false }); + this.props.navigation.goBack(); + }); if (!p1) { this.setState({ isLoading: false }); return; } - let p2 = await prompt(loc.settings.password, loc.settings.retype_password); + let p2 = await prompt(loc.settings.password, loc.settings.retype_password).catch(() => { + this.setState({ isLoading: false }); + this.props.navigation.goBack(); + }); if (p1 === p2) { await BlueApp.encryptStorage(p1); this.setState({ diff --git a/screen/wallets/scanQrWif.js b/screen/wallets/scanQrWif.js index 24a097bdd..235ec6f97 100644 --- a/screen/wallets/scanQrWif.js +++ b/screen/wallets/scanQrWif.js @@ -2,7 +2,7 @@ import React from 'react'; import { Text, ActivityIndicator, Button, View, TouchableOpacity } from 'react-native'; import { BlueText, SafeBlueArea, BlueButton } from '../../BlueComponents'; -import { Camera, Permissions } from 'expo'; +import { Camera, Permissions, BarCodeScanner } from 'expo'; import { SegwitP2SHWallet, LegacyWallet, WatchOnlyWallet } from '../../class'; import PropTypes from 'prop-types'; /** @type {AppStorage} */ @@ -123,7 +123,7 @@ export default class ScanQrWif extends React.Component { onCameraReady: function() { alert('onCameraReady'); }, - barCodeTypes: [Camera.Constants.BarCodeType.qr], + barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr], }); }