mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-11 01:28:58 +01:00
FIX: Many layout bug fixes.
ADD: Autofocus on number inputs OPS: Upgraded to React Native 0.58
This commit is contained in:
parent
6860f6f052
commit
0dccc4782d
29 changed files with 1200 additions and 800 deletions
|
@ -67,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
|||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
||||
|
||||
[version]
|
||||
^0.78.0
|
||||
^0.85.0
|
||||
|
|
|
@ -41,13 +41,14 @@ if (aspectRatio > 1.6) {
|
|||
|
||||
export class BlueButton extends Component {
|
||||
render() {
|
||||
const backgroundColor = this.props.disabled ? '#99a0ab' : '#ccddf9';
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={{
|
||||
flex: 1,
|
||||
borderWidth: 0.7,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: '#ccddf9',
|
||||
backgroundColor: backgroundColor,
|
||||
minHeight: 45,
|
||||
height: 45,
|
||||
borderRadius: 25,
|
||||
|
@ -59,7 +60,7 @@ export class BlueButton extends Component {
|
|||
>
|
||||
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
|
||||
{this.props.icon && <Icon name={this.props.icon.name} type={this.props.icon.type} color={this.props.icon.color} />}
|
||||
<Text style={{ marginHorizontal: 8, fontSize: 16, color: '#0c2550' }}>{this.props.title}</Text>
|
||||
{this.props.title && <Text style={{ marginHorizontal: 8, fontSize: 16, color: '#0c2550' }}>{this.props.title}</Text>}
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
@ -203,7 +204,7 @@ export class BlueCopyTextToClipboard extends Component {
|
|||
|
||||
constructor() {
|
||||
super();
|
||||
UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
|
||||
if (Platform.OS === 'android') UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
|
||||
}
|
||||
|
||||
copyToClipboard = () => {
|
||||
|
@ -1230,6 +1231,7 @@ export class BlueBitcoinAmount extends Component {
|
|||
ref={textInput => (this.textInput = textInput)}
|
||||
editable={!this.props.isLoading && !this.props.disabled}
|
||||
value={amount}
|
||||
autoFocus={this.props.pointerEvents !== 'none'}
|
||||
placeholderTextColor={this.props.disabled ? '#99a0ab' : '#0f5cc0'}
|
||||
style={{
|
||||
color: this.props.disabled ? '#99a0ab' : '#0f5cc0',
|
||||
|
|
|
@ -8,23 +8,13 @@
|
|||
# - `buck install -r android/app` - compile, install and run application
|
||||
#
|
||||
|
||||
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
|
||||
|
||||
lib_deps = []
|
||||
|
||||
for jarfile in glob(['libs/*.jar']):
|
||||
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
|
||||
lib_deps.append(':' + name)
|
||||
prebuilt_jar(
|
||||
name = name,
|
||||
binary_jar = jarfile,
|
||||
)
|
||||
create_aar_targets(glob(["libs/*.aar"]))
|
||||
|
||||
for aarfile in glob(['libs/*.aar']):
|
||||
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
|
||||
lib_deps.append(':' + name)
|
||||
android_prebuilt_aar(
|
||||
name = name,
|
||||
aar = aarfile,
|
||||
)
|
||||
create_jar_targets(glob(["libs/*.jar"]))
|
||||
|
||||
android_library(
|
||||
name = "all-libs",
|
||||
|
|
|
@ -133,7 +133,6 @@
|
|||
<orderEntry type="jdk" jdkName="Android API 27 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Gradle: org.webkit:android-jsc:r174650@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-ads-identifier:16.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-vector-drawable:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:fresco:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.react:react-native:0.57.8@aar" level="project" />
|
||||
|
@ -147,26 +146,21 @@
|
|||
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.11.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.parse.bolts:bolts-tasks:1.4.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:exifinterface:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-analytics-impl:16.0.6@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-v4:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.core:runtime:1.1.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp-urlconnection:3.11.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:animated-vector-drawable:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-okhttp3:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-tagmanager-v4-impl:16.0.6@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-base:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: io.sentry:sentry:1.7.5@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-stats:16.0.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-base:16.0.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-core-ui:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-compat:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.infer.annotation:infer-annotation:0.11.2@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.7.24@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-media-compat:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-basement:16.0.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:3.0.2@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-fragment:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: io.sentry:sentry-android:1.7.5@jar" level="project" />
|
||||
|
@ -174,10 +168,7 @@
|
|||
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7:27.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.core:common:1.1.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-core:2.8.7@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-measurement-base:16.0.5@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.soloader:soloader:0.5.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-tasks:16.0.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-analytics:16.0.6@aar" level="project" />
|
||||
<orderEntry type="module" module-name="react-native-webview" />
|
||||
<orderEntry type="module" module-name="react-native-linear-gradient" />
|
||||
<orderEntry type="module" module-name="react-native-svg" />
|
||||
|
|
|
@ -126,7 +126,7 @@ android {
|
|||
variant.outputs.each { output ->
|
||||
// For each separate APK per architecture, set a unique version code as described here:
|
||||
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
|
||||
def versionCodes = ["armeabi-v7a":1, "x86":2]
|
||||
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
|
||||
def abi = output.getFilter(OutputFile.ABI)
|
||||
if (abi != null) { // null for the universal-debug, universal-release variants
|
||||
output.versionCodeOverride =
|
||||
|
@ -137,22 +137,19 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':react-native-webview')
|
||||
compile project(':react-native-vector-icons')
|
||||
compile project(':react-native-svg')
|
||||
compile project(':react-native-camera')
|
||||
compile project(':react-native-sentry')
|
||||
compile project(':react-native-randombytes')
|
||||
compile project(':react-native-prompt-android')
|
||||
compile project(':react-native-linear-gradient')
|
||||
compile project(':react-native-haptic-feedback')
|
||||
compile project(':react-native-google-analytics-bridge')
|
||||
compile project(':react-native-gesture-handler')
|
||||
compile project(':react-native-fs')
|
||||
compile project(':react-native-device-info')
|
||||
implementation "com.android.support:exifinterface:+"
|
||||
implementation "com.android.support:support-annotations:+"
|
||||
implementation "com.android.support:support-v4:27.1.1"
|
||||
implementation project(':react-native-webview')
|
||||
implementation project(':react-native-svg')
|
||||
implementation project(':react-native-vector-icons')
|
||||
implementation project(':react-native-sentry')
|
||||
implementation project(':react-native-randombytes')
|
||||
implementation project(':react-native-prompt-android')
|
||||
implementation project(':react-native-linear-gradient')
|
||||
implementation project(':react-native-haptic-feedback')
|
||||
implementation project(':react-native-google-analytics-bridge')
|
||||
implementation project(':react-native-gesture-handler')
|
||||
implementation project(':react-native-fs')
|
||||
implementation project(':react-native-device-info')
|
||||
implementation project(':react-native-camera')
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
|
||||
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||
|
|
19
android/app/build_defs.bzl
Normal file
19
android/app/build_defs.bzl
Normal file
|
@ -0,0 +1,19 @@
|
|||
"""Helper definitions to glob .aar and .jar targets"""
|
||||
|
||||
def create_aar_targets(aarfiles):
|
||||
for aarfile in aarfiles:
|
||||
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
|
||||
lib_deps.append(":" + name)
|
||||
android_prebuilt_aar(
|
||||
name = name,
|
||||
aar = aarfile,
|
||||
)
|
||||
|
||||
def create_jar_targets(jarfiles):
|
||||
for jarfile in jarfiles:
|
||||
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
|
||||
lib_deps.append(":" + name)
|
||||
prebuilt_jar(
|
||||
name = name,
|
||||
binary_jar = jarfile,
|
||||
)
|
|
@ -4,11 +4,11 @@
|
|||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
|
||||
<application
|
||||
android:name=".MainApplication"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:allowBackup="false"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,6 +3,17 @@ package io.bluewallet.bluewallet;
|
|||
import android.app.Application;
|
||||
|
||||
import com.facebook.react.ReactApplication;
|
||||
import com.reactnativecommunity.webview.RNCWebViewPackage;
|
||||
import io.sentry.RNSentryPackage;
|
||||
import com.bitgo.randombytes.RandomBytesPackage;
|
||||
import im.shimo.react.prompt.RNPromptPackage;
|
||||
import com.BV.LinearGradient.LinearGradientPackage;
|
||||
import com.mkuczera.RNReactNativeHapticFeedbackPackage;
|
||||
import com.idehub.GoogleAnalyticsBridge.GoogleAnalyticsBridgePackage;
|
||||
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
|
||||
import com.rnfs.RNFSPackage;
|
||||
import com.learnium.RNDeviceInfo.RNDeviceInfo;
|
||||
import org.reactnative.camera.RNCameraPackage;
|
||||
import io.sentry.RNSentryPackage;
|
||||
import com.bitgo.randombytes.RandomBytesPackage;
|
||||
import im.shimo.react.prompt.RNPromptPackage;
|
||||
|
@ -42,19 +53,18 @@ public class MainApplication extends Application implements ReactApplication {
|
|||
protected List<ReactPackage> getPackages() {
|
||||
return Arrays.<ReactPackage>asList(
|
||||
new MainReactPackage(),
|
||||
new RNCWebViewPackage(),
|
||||
new RNSentryPackage(),
|
||||
new RandomBytesPackage(),
|
||||
new RNPromptPackage(),
|
||||
new LinearGradientPackage(),
|
||||
new RNReactNativeHapticFeedbackPackage(),
|
||||
new GoogleAnalyticsBridgePackage(),
|
||||
new RNCWebViewPackage(),
|
||||
new RNDeviceInfo(),
|
||||
new LinearGradientPackage(),
|
||||
new RNFSPackage() ,
|
||||
new VectorIconsPackage(),
|
||||
new SvgPackage(),
|
||||
new LinearGradientPackage(),
|
||||
new RNDeviceInfo(),
|
||||
new RNCameraPackage(),
|
||||
new RNCameraPackage(),
|
||||
new RNGestureHandlerPackage()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
buildscript {
|
||||
ext {
|
||||
buildToolsVersion = "28.0.3"
|
||||
buildToolsVersion = "28.0.2"
|
||||
minSdkVersion = 16
|
||||
compileSdkVersion = 27
|
||||
targetSdkVersion = 26
|
||||
supportLibVersion = "27.1.1"
|
||||
compileSdkVersion = 28
|
||||
targetSdkVersion = 27
|
||||
supportLibVersion = "28.0.0"
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
|
@ -34,6 +34,6 @@ allprojects {
|
|||
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '4.4'
|
||||
gradleVersion = '4.7'
|
||||
distributionUrl = distributionUrl.replace("bin", "all")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#Sat Jan 19 02:29:20 GMT 2019
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
|
||||
|
|
|
@ -3,10 +3,6 @@ include ':react-native-webview'
|
|||
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
|
||||
include ':react-native-svg'
|
||||
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
|
||||
include ':react-native-fs'
|
||||
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
|
||||
include ':react-native-gesture-handler'
|
||||
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
|
||||
include ':react-native-vector-icons'
|
||||
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
|
||||
include ':react-native-sentry'
|
||||
|
@ -21,6 +17,10 @@ include ':react-native-haptic-feedback'
|
|||
project(':react-native-haptic-feedback').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-haptic-feedback/android')
|
||||
include ':react-native-google-analytics-bridge'
|
||||
project(':react-native-google-analytics-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-analytics-bridge/android')
|
||||
include ':react-native-gesture-handler'
|
||||
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
|
||||
include ':react-native-fs'
|
||||
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
|
||||
include ':react-native-device-info'
|
||||
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
|
||||
include ':react-native-camera'
|
||||
|
|
3
babel.config.js
Normal file
3
babel.config.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
presets: ['module:metro-react-native-babel-preset'],
|
||||
};
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
|
@ -22,18 +22,14 @@
|
|||
{
|
||||
NSURL *jsCodeLocation;
|
||||
|
||||
#ifdef DEBUG
|
||||
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||
#else
|
||||
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||
#endif
|
||||
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||
|
||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
|
||||
moduleName:@"BlueWallet"
|
||||
initialProperties:nil
|
||||
launchOptions:launchOptions];
|
||||
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
|
||||
[RNSentry installWithRootView:rootView];
|
||||
rootView.backgroundColor = [UIColor blackColor];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
UIViewController *rootViewController = [UIViewController new];
|
||||
rootViewController.view = rootView;
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<key>NSCalendarsUsageDescription</key>
|
||||
<string>This alert should not show up as we do not require this data</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>In order to quickly scan the recipient's address, we need your permission to use the camera to scan their QR Code.</string>
|
||||
<string>In order to quickly scan the recipient's address, we need your permission to use the camera to scan their QR Code.</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>This alert should not show up as we do not require this data</string>
|
||||
<key>NSMotionUsageDescription</key>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
|
|
649
package-lock.json
generated
649
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -59,7 +59,7 @@
|
|||
"prop-types": "^15.6.2",
|
||||
"react": "^16.7.0",
|
||||
"react-localization": "^1.0.10",
|
||||
"react-native": "^0.57.8",
|
||||
"react-native": "^0.58.0",
|
||||
"react-native-camera": "^1.9.1",
|
||||
"react-native-custom-qr-codes": "^2.0.0",
|
||||
"react-native-device-info": "^0.25.1",
|
||||
|
@ -80,9 +80,9 @@
|
|||
"react-native-sentry": "^0.40.2",
|
||||
"react-native-snap-carousel": "^3.7.4",
|
||||
"react-native-sortable-list": "0.0.22",
|
||||
"react-native-svg": "^9.0.3",
|
||||
"react-native-svg": "^9.0.4",
|
||||
"react-native-vector-icons": "^6.2.0",
|
||||
"react-native-webview": "2.8.0",
|
||||
"react-native-webview": "^3.2.1",
|
||||
"react-native-wkwebview-reborn": "^2.0.0",
|
||||
"react-navigation": "^3.0.9",
|
||||
"react-test-render": "^1.1.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* global alert */
|
||||
import React from 'react';
|
||||
import { Text, Dimensions, ActivityIndicator, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
|
||||
import { Text, ActivityIndicator, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
BlueSpacing20,
|
||||
|
@ -17,7 +17,6 @@ import { BitcoinUnit } from '../../models/bitcoinUnits';
|
|||
let BlueApp = require('../../BlueApp');
|
||||
let EV = require('../../events');
|
||||
let loc = require('../../loc');
|
||||
const { width } = Dimensions.get('window');
|
||||
|
||||
export default class ScanLndInvoice extends React.Component {
|
||||
static navigationOptions = ({ navigation }) => ({
|
||||
|
@ -36,7 +35,7 @@ export default class ScanLndInvoice extends React.Component {
|
|||
|
||||
if (!BlueApp.getWallets().some(item => item.type === LightningCustodianWallet.type)) {
|
||||
alert('Before paying a Lightning invoice, you must first add a Lightning wallet.');
|
||||
props.navigation.dismiss();
|
||||
// props.navigation.dismiss();
|
||||
} else {
|
||||
let fromSecret;
|
||||
if (props.navigation.state.params.fromSecret) fromSecret = props.navigation.state.params.fromSecret;
|
||||
|
@ -72,7 +71,6 @@ export default class ScanLndInvoice extends React.Component {
|
|||
}
|
||||
|
||||
processInvoice = data => {
|
||||
this.props.navigation.goBack(null);
|
||||
this.setState({ isLoading: true }, async () => {
|
||||
if (this.ignoreRead) return;
|
||||
this.ignoreRead = true;
|
||||
|
@ -237,27 +235,26 @@ export default class ScanLndInvoice extends React.Component {
|
|||
{this.state.expiresIn !== undefined && (
|
||||
<Text style={{ color: '#81868e', fontSize: 12, left: 20, top: 10 }}>Expires in: {this.state.expiresIn}</Text>
|
||||
)}
|
||||
<BlueSpacing20 />
|
||||
{this.state.isLoading ? (
|
||||
<View>
|
||||
<ActivityIndicator />
|
||||
</View>
|
||||
) : (
|
||||
<BlueButton
|
||||
icon={{
|
||||
name: 'bolt',
|
||||
type: 'font-awesome',
|
||||
color: BlueApp.settings.buttonTextColor,
|
||||
}}
|
||||
title={'Pay'}
|
||||
onPress={() => {
|
||||
this.pay();
|
||||
}}
|
||||
disabled={this.shouldDisablePayButton()}
|
||||
/>
|
||||
)}
|
||||
</BlueCard>
|
||||
<BlueSpacing20 />
|
||||
{this.state.isLoading ? (
|
||||
<View>
|
||||
<ActivityIndicator />
|
||||
</View>
|
||||
) : (
|
||||
<BlueButton
|
||||
icon={{
|
||||
name: 'bolt',
|
||||
type: 'font-awesome',
|
||||
color: BlueApp.settings.buttonTextColor,
|
||||
}}
|
||||
title={'Pay'}
|
||||
buttonStyle={{ width: 150, left: (width - 150) / 2 - 20 }}
|
||||
onPress={() => {
|
||||
this.pay();
|
||||
}}
|
||||
disabled={this.shouldDisablePayButton()}
|
||||
/>
|
||||
)}
|
||||
</SafeBlueArea>
|
||||
</TouchableWithoutFeedback>
|
||||
);
|
||||
|
|
|
@ -97,7 +97,7 @@ export default class ReceiveDetails extends Component {
|
|||
/>
|
||||
<BlueCopyTextToClipboard text={this.state.addressText} />
|
||||
</View>
|
||||
<View style={{ marginBottom: 24, alignItems: 'center' }}>
|
||||
<View style={{ flex: 0.2, marginBottom: 24, alignItems: 'center' }}>
|
||||
<BlueButtonLink
|
||||
title={loc.receive.details.setAmount}
|
||||
onPress={() => {
|
||||
|
|
|
@ -3,7 +3,15 @@ import { View, Share, TextInput, KeyboardAvoidingView, Platform, Dimensions, Scr
|
|||
import { QRCode as QRSlow } from 'react-native-custom-qr-codes';
|
||||
import QRFast from 'react-native-qrcode';
|
||||
import bip21 from 'bip21';
|
||||
import { SafeBlueArea, BlueButton, BlueNavigationStyle, BlueBitcoinAmount, BlueText, BlueCopyTextToClipboard } from '../../BlueComponents';
|
||||
import {
|
||||
SafeBlueArea,
|
||||
BlueCard,
|
||||
BlueButton,
|
||||
BlueNavigationStyle,
|
||||
BlueBitcoinAmount,
|
||||
BlueText,
|
||||
BlueCopyTextToClipboard,
|
||||
} from '../../BlueComponents';
|
||||
import PropTypes from 'prop-types';
|
||||
/** @type {AppStorage} */
|
||||
let BlueApp = require('../../BlueApp');
|
||||
|
@ -75,15 +83,17 @@ export default class ReceiveAmount extends Component {
|
|||
editable={!this.state.isLoading}
|
||||
/>
|
||||
</View>
|
||||
<BlueButton
|
||||
title={loc.receive.create}
|
||||
onPress={() => {
|
||||
this.setState({
|
||||
amountSet: true,
|
||||
bip21: bip21.encode(this.state.address, { amount: this.state.amount, label: this.state.label }),
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<BlueCard>
|
||||
<BlueButton
|
||||
title={loc.receive.details.create}
|
||||
onPress={() => {
|
||||
this.setState({
|
||||
amountSet: true,
|
||||
bip21: bip21.encode(this.state.address, { amount: this.state.amount, label: this.state.label }),
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</BlueCard>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
@ -113,7 +123,7 @@ export default class ReceiveAmount extends Component {
|
|||
/>
|
||||
)}
|
||||
</View>
|
||||
<View style={{ marginBottom: 24, alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<View style={{ alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<BlueCopyTextToClipboard text={this.state.bip21} />
|
||||
</View>
|
||||
</View>
|
||||
|
@ -134,23 +144,21 @@ export default class ReceiveAmount extends Component {
|
|||
{this.state.amountSet ? this.renderWithSetAmount() : this.renderDefault()}
|
||||
</KeyboardAvoidingView>
|
||||
{this.state.amountSet && (
|
||||
<BlueButton
|
||||
buttonStyle={{
|
||||
alignSelf: 'center',
|
||||
marginBottom: 24,
|
||||
}}
|
||||
icon={{
|
||||
name: 'share-alternative',
|
||||
type: 'entypo',
|
||||
color: BlueApp.settings.buttonTextColor,
|
||||
}}
|
||||
onPress={async () => {
|
||||
Share.share({
|
||||
message: this.state.bip21,
|
||||
});
|
||||
}}
|
||||
title={loc.receive.details.share}
|
||||
/>
|
||||
<BlueCard>
|
||||
<BlueButton
|
||||
icon={{
|
||||
name: 'share-alternative',
|
||||
type: 'entypo',
|
||||
color: BlueApp.settings.buttonTextColor,
|
||||
}}
|
||||
onPress={async () => {
|
||||
Share.share({
|
||||
message: this.state.bip21,
|
||||
});
|
||||
}}
|
||||
title={loc.receive.details.share}
|
||||
/>
|
||||
</BlueCard>
|
||||
)}
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
|
|
@ -25,6 +25,7 @@ export default class CameraExample extends React.Component {
|
|||
|
||||
const onBarScanned = this.props.navigation.getParam('onBarScanned');
|
||||
onBarScanned(ret.data);
|
||||
this.props.navigation.goBack(null);
|
||||
} // end
|
||||
|
||||
componentDidMount() {
|
||||
|
|
|
@ -120,88 +120,88 @@ export default class WalletDetails extends Component {
|
|||
{loc.wallets.details.type.toLowerCase()}
|
||||
</Text>
|
||||
<Text style={{ color: '#81868e', fontWeight: '500', fontSize: 14 }}>{this.state.wallet.typeReadable}</Text>
|
||||
</BlueCard>
|
||||
<View>
|
||||
<BlueSpacing20 />
|
||||
<BlueButton
|
||||
onPress={() =>
|
||||
this.props.navigation.navigate('WalletExport', {
|
||||
address: this.state.wallet.getAddress(),
|
||||
secret: this.state.wallet.getSecret(),
|
||||
})
|
||||
}
|
||||
title={loc.wallets.details.export_backup}
|
||||
/>
|
||||
|
||||
<BlueSpacing20 />
|
||||
|
||||
{(this.state.wallet.type === HDLegacyBreadwalletWallet.type ||
|
||||
this.state.wallet.type === HDLegacyP2PKHWallet.type ||
|
||||
this.state.wallet.type === HDSegwitP2SHWallet.type) && (
|
||||
<React.Fragment>
|
||||
<BlueButton
|
||||
onPress={() =>
|
||||
this.props.navigation.navigate('WalletXpub', {
|
||||
secret: this.state.wallet.getSecret(),
|
||||
})
|
||||
}
|
||||
title={loc.wallets.details.show_xpub}
|
||||
/>
|
||||
|
||||
<BlueSpacing20 />
|
||||
</React.Fragment>
|
||||
)}
|
||||
|
||||
{this.state.wallet.type !== LightningCustodianWallet.type && (
|
||||
<View>
|
||||
<BlueSpacing20 />
|
||||
<BlueButton
|
||||
icon={{
|
||||
name: 'shopping-cart',
|
||||
type: 'font-awesome',
|
||||
color: BlueApp.settings.buttonTextColor,
|
||||
}}
|
||||
onPress={() =>
|
||||
this.props.navigation.navigate('BuyBitcoin', {
|
||||
this.props.navigation.navigate('WalletExport', {
|
||||
address: this.state.wallet.getAddress(),
|
||||
secret: this.state.wallet.getSecret(),
|
||||
})
|
||||
}
|
||||
title={loc.wallets.details.buy_bitcoin}
|
||||
title={loc.wallets.details.export_backup}
|
||||
/>
|
||||
)}
|
||||
<BlueSpacing20 />
|
||||
|
||||
<TouchableOpacity
|
||||
style={{ alignItems: 'center' }}
|
||||
onPress={() => {
|
||||
ReactNativeHapticFeedback.trigger('notificationWarning', false);
|
||||
Alert.alert(
|
||||
loc.wallets.details.delete + ' ' + loc.wallets.details.title,
|
||||
loc.wallets.details.are_you_sure,
|
||||
[
|
||||
{
|
||||
text: loc.wallets.details.yes_delete,
|
||||
onPress: async () => {
|
||||
this.props.navigation.setParams({ isLoading: true });
|
||||
this.setState({ isLoading: true }, async () => {
|
||||
BlueApp.deleteWallet(this.state.wallet);
|
||||
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
|
||||
await BlueApp.saveToDisk();
|
||||
EV(EV.enum.TRANSACTIONS_COUNT_CHANGED);
|
||||
EV(EV.enum.WALLETS_COUNT_CHANGED);
|
||||
this.props.navigation.navigate('Wallets');
|
||||
});
|
||||
<BlueSpacing20 />
|
||||
|
||||
{(this.state.wallet.type === HDLegacyBreadwalletWallet.type ||
|
||||
this.state.wallet.type === HDLegacyP2PKHWallet.type ||
|
||||
this.state.wallet.type === HDSegwitP2SHWallet.type) && (
|
||||
<React.Fragment>
|
||||
<BlueButton
|
||||
onPress={() =>
|
||||
this.props.navigation.navigate('WalletXpub', {
|
||||
secret: this.state.wallet.getSecret(),
|
||||
})
|
||||
}
|
||||
title={loc.wallets.details.show_xpub}
|
||||
/>
|
||||
|
||||
<BlueSpacing20 />
|
||||
</React.Fragment>
|
||||
)}
|
||||
|
||||
{this.state.wallet.type !== LightningCustodianWallet.type && (
|
||||
<BlueButton
|
||||
icon={{
|
||||
name: 'shopping-cart',
|
||||
type: 'font-awesome',
|
||||
color: BlueApp.settings.buttonTextColor,
|
||||
}}
|
||||
onPress={() =>
|
||||
this.props.navigation.navigate('BuyBitcoin', {
|
||||
address: this.state.wallet.getAddress(),
|
||||
secret: this.state.wallet.getSecret(),
|
||||
})
|
||||
}
|
||||
title={loc.wallets.details.buy_bitcoin}
|
||||
/>
|
||||
)}
|
||||
<BlueSpacing20 />
|
||||
|
||||
<TouchableOpacity
|
||||
style={{ alignItems: 'center' }}
|
||||
onPress={() => {
|
||||
ReactNativeHapticFeedback.trigger('notificationWarning', false);
|
||||
Alert.alert(
|
||||
loc.wallets.details.delete + ' ' + loc.wallets.details.title,
|
||||
loc.wallets.details.are_you_sure,
|
||||
[
|
||||
{
|
||||
text: loc.wallets.details.yes_delete,
|
||||
onPress: async () => {
|
||||
this.props.navigation.setParams({ isLoading: true });
|
||||
this.setState({ isLoading: true }, async () => {
|
||||
BlueApp.deleteWallet(this.state.wallet);
|
||||
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
|
||||
await BlueApp.saveToDisk();
|
||||
EV(EV.enum.TRANSACTIONS_COUNT_CHANGED);
|
||||
EV(EV.enum.WALLETS_COUNT_CHANGED);
|
||||
this.props.navigation.navigate('Wallets');
|
||||
});
|
||||
},
|
||||
style: 'destructive',
|
||||
},
|
||||
style: 'destructive',
|
||||
},
|
||||
{ text: loc.wallets.details.no_cancel, onPress: () => {}, style: 'cancel' },
|
||||
],
|
||||
{ cancelable: false },
|
||||
);
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: '#d0021b', fontSize: 15, fontWeight: '500' }}>{loc.wallets.details.delete}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
{ text: loc.wallets.details.no_cancel, onPress: () => {}, style: 'cancel' },
|
||||
],
|
||||
{ cancelable: false },
|
||||
);
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: '#d0021b', fontSize: 15, fontWeight: '500' }}>{loc.wallets.details.delete}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</BlueCard>
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
</SafeBlueArea>
|
||||
|
|
|
@ -82,7 +82,7 @@ export default class WalletMigrate extends Component {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignContent: 'center' }}>
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignContent: 'center', backgroundColor: '#ffffff' }}>
|
||||
<ActivityIndicator />
|
||||
</View>
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue