Upgraded to React Native 0.59 & Pin deps to exact version (#515)

* remove jsc-android required changes

* working

* working

* working

* tests green AF

* fix linter errors

* turn on inline requires
pull/516/head
Bruno Barbieri 4 years ago committed by GitHub
parent e68e2b1126
commit 69381f094e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .prettierignore
  2. 34
      android/app/build.gradle
  3. 3
      android/app/src/main/AndroidManifest.xml
  4. 0
      android/app/src/main/assets/fonts/AntDesign.ttf
  5. 0
      android/app/src/main/assets/fonts/Entypo.ttf
  6. 0
      android/app/src/main/assets/fonts/EvilIcons.ttf
  7. 0
      android/app/src/main/assets/fonts/FontAwesome.ttf
  8. BIN
      android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf
  9. BIN
      android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf
  10. BIN
      android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf
  11. 0
      android/app/src/main/assets/fonts/Foundation.ttf
  12. 0
      android/app/src/main/assets/fonts/Ionicons.ttf
  13. BIN
      android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
  14. 0
      android/app/src/main/assets/fonts/MaterialIcons.ttf
  15. 0
      android/app/src/main/assets/fonts/Octicons.ttf
  16. 0
      android/app/src/main/assets/fonts/SimpleLineIcons.ttf
  17. 0
      android/app/src/main/assets/fonts/Zocial.ttf
  18. 6
      android/app/src/main/java/io/metamask/MainApplication.java
  19. 8
      android/app/src/main/res/xml/react_native_config.xml
  20. 16
      android/build.gradle
  21. BIN
      android/gradle/wrapper/gradle-wrapper.jar
  22. 2
      android/gradle/wrapper/gradle-wrapper.properties
  23. 10
      android/settings.gradle
  24. 4
      app/components/UI/ActionView/__snapshots__/index.test.js.snap
  25. 2
      app/components/UI/AddCustomCollectible/__snapshots__/index.test.js.snap
  26. 3
      app/components/UI/AddCustomToken/__snapshots__/index.test.js.snap
  27. 1
      app/components/UI/AssetSearch/__snapshots__/index.test.js.snap
  28. 6
      app/components/UI/CollectibleContractInformation/__snapshots__/index.test.js.snap
  29. 1
      app/components/UI/CollectibleContracts/__snapshots__/index.test.js.snap
  30. 4
      app/components/UI/Collectibles/__snapshots__/index.test.js.snap
  31. 6
      app/components/UI/CustomAlert/index.js
  32. 2
      app/components/UI/FoxScreen/__snapshots__/index.test.js.snap
  33. 10
      app/components/UI/HomePage/__snapshots__/index.test.js.snap
  34. 48
      app/components/UI/HomePage/index.js
  35. 11
      app/components/UI/Navbar/index.js
  36. 4
      app/components/UI/NetworkList/__snapshots__/index.test.js.snap
  37. 6
      app/components/UI/PhishingModal/__snapshots__/index.test.js.snap
  38. 2
      app/components/UI/SignatureRequest/__snapshots__/index.test.js.snap
  39. 1
      app/components/UI/TransactionEdit/__snapshots__/index.test.js.snap
  40. 4
      app/components/UI/TransactionEditor/index.js
  41. 2
      app/components/UI/TransactionNotification/index.js
  42. 1
      app/components/UI/TransactionReview/TransactionReviewData/__snapshots__/index.test.js.snap
  43. 6
      app/components/UI/UrlAutocomplete/index.js
  44. 2
      app/components/UI/WebsiteIcon/__snapshots__/index.test.js.snap
  45. 4
      app/components/Views/AccountBackupStep1/__snapshots__/index.test.js.snap
  46. 4
      app/components/Views/AccountBackupStep2/__snapshots__/index.test.js.snap
  47. 4
      app/components/Views/AccountBackupStep3/__snapshots__/index.test.js.snap
  48. 4
      app/components/Views/AccountBackupStep4/__snapshots__/index.test.js.snap
  49. 4
      app/components/Views/AccountBackupStep5/__snapshots__/index.test.js.snap
  50. 6
      app/components/Views/AccountBackupStep6/__snapshots__/index.test.js.snap
  51. 2
      app/components/Views/AddBookmark/__snapshots__/index.test.js.snap
  52. 5
      app/components/Views/AdvancedSettings/__snapshots__/index.test.js.snap
  53. 6
      app/components/Views/Approval/index.js
  54. 1
      app/components/Views/Browser/__snapshots__/index.test.js.snap
  55. 6
      app/components/Views/ChoosePassword/__snapshots__/index.test.js.snap
  56. 2
      app/components/Views/ChoosePassword/index.js
  57. 4
      app/components/Views/Collectible/__snapshots__/index.test.js.snap
  58. 4
      app/components/Views/CollectibleView/__snapshots__/index.test.js.snap
  59. 4
      app/components/Views/CreateWallet/index.js
  60. 2
      app/components/Views/Entry/index.js
  61. 4
      app/components/Views/GeneralSettings/__snapshots__/index.test.js.snap
  62. 7
      app/components/Views/ImportFromSeed/__snapshots__/index.test.js.snap
  63. 2
      app/components/Views/ImportFromSeed/index.js
  64. 5
      app/components/Views/ImportPrivateKey/__snapshots__/index.test.js.snap
  65. 4
      app/components/Views/ImportPrivateKeySuccess/__snapshots__/index.test.js.snap
  66. 13
      app/components/Views/ImportWallet/index.js
  67. 5
      app/components/Views/Login/__snapshots__/index.test.js.snap
  68. 2
      app/components/Views/Login/index.js
  69. 4
      app/components/Views/Onboarding/__snapshots__/index.test.js.snap
  70. 3
      app/components/Views/Onboarding/index.js
  71. 4
      app/components/Views/ProtectYourAccount/__snapshots__/index.test.js.snap
  72. 2
      app/components/Views/QRScanner/__snapshots__/index.test.js.snap
  73. 1
      app/components/Views/RevealPrivateCredential/__snapshots__/index.test.js.snap
  74. 12
      app/components/Views/RevealPrivateCredential/index.js
  75. 4
      app/components/Views/SecuritySettings/__snapshots__/index.test.js.snap
  76. 3
      app/components/Views/SecuritySettings/index.js
  77. 3
      app/components/Views/SyncWithExtension/index.js
  78. 2
      app/core/Engine.js
  79. 4
      app/store/index.js
  80. 5
      babel.config.js
  81. 1
      index.js
  82. 208
      ios/MetaMask.xcodeproj/project.pbxproj
  83. 129
      ios/MetaMask.xcodeproj/xcshareddata/xcschemes/metamask-tvOS.xcscheme
  84. 3
      ios/MetaMask/AppDelegate.h
  85. 35
      ios/MetaMask/AppDelegate.m
  86. 5
      ios/MetaMask/Info.plist
  87. 12
      jest.preprocessor.js
  88. 3
      locales/i18n.js
  89. 18
      metro.config.js
  90. 8396
      package-lock.json
  91. 175
      package.json
  92. 59
      scripts/postinstall.sh

@ -11,5 +11,6 @@ package.json
app/util/blockies.js
/shim.js
babel.config.js
metro.config.js
jest.preprocessor.js
scripts/metamask-bot-build-announce.js

@ -46,6 +46,7 @@ apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
import com.android.build.OutputFile
@ -162,12 +163,12 @@ android {
buildFabricPropertiesIfNeeded()
}
packagingOptions {
pickFirst '**/libjsc.so'
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "io.metamask"
@ -190,7 +191,7 @@ android {
MM_BRANCH_KEY_TEST: "$System.env.MM_BRANCH_KEY_TEST",
MM_BRANCH_KEY_LIVE: "$System.env.MM_BRANCH_KEY_LIVE"
]
missingDimensionStrategy 'react-native-camera', 'general'
}
@ -209,7 +210,7 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a"
include "armeabi-v7a", "x86", "arm64-v8a", "x86-64"
}
}
buildTypes {
@ -232,7 +233,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, "arm64-v8a": 3]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86-64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
@ -242,13 +243,8 @@ android {
}
}
configurations.all {
resolutionStrategy {
force 'org.webkit:android-jsc:r236355'
}
}
dependencies {
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-push-notification')
implementation project(':react-native-background-timer')
implementation project(':react-native-device-info')
@ -271,20 +267,18 @@ dependencies {
implementation project(':react-native-aes-crypto')
implementation project(':react-native-keychain')
implementation project(':react-native-os')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-randombytes')
implementation project(':react-native-fs')
implementation project(':react-native-vector-icons')
implementation project(':react-native-shake')
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
transitive = true;
}
androidTestImplementation(project(path: ":detox"))
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
// androidTestImplementation(project(path: ":detox"))
// androidTestImplementation 'junit:junit:4.12'
// androidTestImplementation 'com.android.support.test:runner:1.0.1'
// androidTestImplementation 'com.android.support.test:rules:1.0.1'
}
// Run this once to be able to run the application with BUCK

@ -17,6 +17,9 @@
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="${isDebug}"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning"
android:networkSecurityConfig="@xml/react_native_config"
>
<activity
android:launchMode="singleTask"

@ -4,12 +4,12 @@ import android.app.Application;
import com.crashlytics.android.Crashlytics;
import com.facebook.react.ReactApplication;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.ocetnik.timer.BackgroundTimerPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.horcrux.svg.SvgPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.clipsub.RNShake.RNShakeEventPackage;
import io.branch.rnbranch.RNBranchPackage;
import io.branch.referral.Branch;
import com.web3webview.Web3WebviewPackage;
@ -17,7 +17,6 @@ import com.oblador.vectoricons.VectorIconsPackage;
import cl.json.RNSharePackage;
import com.bitgo.randombytes.RandomBytesPackage;
import com.peel.react.rnos.RNOSModule;
import com.BV.LinearGradient.LinearGradientPackage;
import com.oblador.keychain.KeychainPackage;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.rnfs.RNFSPackage;
@ -49,17 +48,16 @@ public class MainApplication extends MultiDexApplication implements ShareApplica
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new AsyncStoragePackage(),
new ReactNativePushNotificationPackage(),
new BackgroundTimerPackage(),
new RNDeviceInfo(),
new SvgPackage(),
new RNGestureHandlerPackage(),
new RNScreensPackage(),
new RNShakeEventPackage(),
new RNBranchPackage(),
new FabricPackage(),
new KeychainPackage(),
new LinearGradientPackage(),
new RandomBytesPackage(),
new RCTAesPackage(),
new RNCameraPackage(),

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
</domain-config>
</network-security-config>

@ -3,7 +3,7 @@
buildscript {
ext {
buildToolsVersion = "28.0.2"
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
@ -16,7 +16,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -32,10 +32,7 @@ allprojects {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Local Maven repo containing AARs with JSC library built for Android
url "$rootDir/../node_modules/jsc-android/dist"
}
maven { url "https://jitpack.io" }
}
subprojects {
@ -64,10 +61,3 @@ subprojects {project ->
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}

Binary file not shown.

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip

@ -1,4 +1,6 @@
rootProject.name = 'MetaMask'
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
include ':react-native-background-timer'
@ -11,13 +13,11 @@ 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-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
include ':react-native-shake'
project(':react-native-shake').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-shake/android')
include ':react-native-branch'
project(':react-native-branch').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-branch/android')
include ':detox'
project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')
// include ':detox'
// project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')
include ':react-native-aes-crypto'
project(':react-native-aes-crypto').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-aes-crypto/android')
include ':react-native-camera'
@ -30,8 +30,6 @@ include ':react-native-i18n'
project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android')
include ':react-native-keychain'
project(':react-native-keychain').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keychain/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-os'
project(':react-native-os').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-os/android')
include ':react-native-share'

@ -8,7 +8,7 @@ exports[`ActionView should render correctly 1`] = `
}
}
>
<KeyboardAwareScrollView
<KeyboardAwareScrollViewMock
enableAutomaticScroll={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}
@ -35,7 +35,7 @@ exports[`ActionView should render correctly 1`] = `
}
}
/>
</KeyboardAwareScrollView>
</KeyboardAwareScrollViewMock>
<View
style={
Object {

@ -46,6 +46,7 @@ exports[`AddCustomCollectible should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder="0x..."
rejectResponderTermination={true}
style={
Array [
Object {
@ -97,6 +98,7 @@ exports[`AddCustomCollectible should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder=""
rejectResponderTermination={true}
returnKeyType="done"
style={
Array [

@ -46,6 +46,7 @@ exports[`AddCustomToken should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder="0x..."
rejectResponderTermination={true}
returnKeyType="next"
style={
Object {
@ -94,6 +95,7 @@ exports[`AddCustomToken should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder="GNO"
rejectResponderTermination={true}
returnKeyType="next"
style={
Object {
@ -144,6 +146,7 @@ exports[`AddCustomToken should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder="18"
rejectResponderTermination={true}
returnKeyType="done"
style={
Object {

@ -31,6 +31,7 @@ exports[`AssetSearch should render correctly 1`] = `
allowFontScaling={true}
onChangeText={[Function]}
placeholder="Search Tokens"
rejectResponderTermination={true}
style={
Object {
"flex": 1,

@ -35,7 +35,7 @@ exports[`CollectibleContractInformation should render correctly 1`] = `
name
</Text>
</View>
<ScrollView
<ScrollViewMock
style={
Object {
"flex": 1,
@ -189,7 +189,7 @@ exports[`CollectibleContractInformation should render correctly 1`] = `
>
Powered by
</Text>
<Component
<Image
source={
Object {
"testUri": "../../../app/images/opensea-logo-flat-colored-blue.png",
@ -206,7 +206,7 @@ exports[`CollectibleContractInformation should render correctly 1`] = `
</View>
</TouchableOpacity>
</View>
</ScrollView>
</ScrollViewMock>
<View
style={
Object {

@ -43,6 +43,7 @@ exports[`CollectibleContracts should render correctly 1`] = `
refreshing={false}
/>
}
removeClippedSubviews={false}
renderItem={[Function]}
scrollEventThrottle={50}
updateCellsBatchingPeriod={50}

@ -10,7 +10,7 @@ exports[`Collectibles should render correctly 1`] = `
}
testID="collectibles"
>
<ScrollView
<ScrollViewMock
refreshControl={
<RefreshControlMock
refreshing={false}
@ -40,7 +40,7 @@ exports[`Collectibles should render correctly 1`] = `
You don't have any collectibles!
</Text>
</View>
</ScrollView>
</ScrollViewMock>
<ActionSheet
cancelButtonIndex={1}
destructiveButtonIndex={0}

@ -81,7 +81,11 @@ export default class CustomAlert extends Component {
/**
/* Direction of the swipe gesture to trigger a swipeComplete event
*/
swipeDirection: PropTypes.string
swipeDirection: PropTypes.string,
/**
/* Children components
*/
children: PropTypes.any
};
render() {

@ -17,7 +17,7 @@ exports[`FoxScreen should render correctly 1`] = `
}
testID="fox-screen"
>
<Component
<Image
resizeMethod="auto"
source={
Object {

@ -9,7 +9,7 @@ exports[`HomePage should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
style={
Object {
"backgroundColor": "#f9fafa",
@ -47,11 +47,13 @@ exports[`HomePage should render correctly 1`] = `
allowFontScaling={true}
autoCapitalize="none"
autoCorrect={false}
blurOnSubmit={true}
clearButtonMode="while-editing"
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder="SEARCH"
placeholderTextColor="#747d8c"
rejectResponderTermination={true}
returnKeyType="go"
style={
Array [
@ -110,7 +112,7 @@ exports[`HomePage should render correctly 1`] = `
}
}
>
<Component
<Image
resizeMethod="auto"
source={
Object {
@ -135,7 +137,7 @@ exports[`HomePage should render correctly 1`] = `
}
}
>
<Component
<Image
resizeMethod="auto"
source={
Object {
@ -243,6 +245,6 @@ exports[`HomePage should render correctly 1`] = `
</ScrollableTabView>
</View>
</TouchableWithoutFeedback>
</ScrollView>
</ScrollViewMock>
</View>
`;

@ -195,7 +195,15 @@ class HomePage extends Component {
/**
* function that removes a bookmark
*/
removeBookmark: PropTypes.func
removeBookmark: PropTypes.func,
/**
* Default protocol of the browser, for ex. https
*/
defaultProtocol: PropTypes.string,
/**
* Default search engine
*/
searchEngine: PropTypes.string
};
state = {
@ -285,7 +293,7 @@ class HomePage extends Component {
dismissKeyboardAndClear = () => {
this.mounted && this.setState({ searchInputValue: '' });
Keyboard.dismiss();
this.searchInput && this.searchInput.current && this.searchInput.current.blur();
};
keyboardDidHide = () => {
@ -308,7 +316,6 @@ class HomePage extends Component {
<View style={styles.flex}>
<View style={styles.searchWrapper}>
<TextInput
ref={this.searchInput}
style={[
styles.searchInput,
this.state.inputWidth ? { width: this.state.inputWidth } : {}
@ -322,6 +329,7 @@ class HomePage extends Component {
placeholderTextColor={colors.asphalt}
returnKeyType="go"
value={this.state.searchInputValue}
blurOnSubmit
/>
<FeatherIcon
onPress={this.focusInput}
@ -357,7 +365,6 @@ class HomePage extends Component {
</View>
<ScrollableTabView
ref={this.scrollableTabViewRef}
renderTabBar={this.renderTabBar}
// eslint-disable-next-line react/jsx-no-bind
onChangeTab={obj => this.handleTabHeight(obj)}
@ -391,24 +398,21 @@ class HomePage extends Component {
/>
</View>
)}
{this.props.passwordSet &&
!this.props.seedphraseBackedUp && (
<TouchableOpacity style={styles.backupAlert} onPress={this.backupAlertPress}>
<ElevatedView elevation={4} style={styles.backupAlertWrapper}>
<View style={styles.backupAlertIconWrapper}>
<Icon name="info-outline" style={styles.backupAlertIcon} />
</View>
<View>
<Text style={styles.backupAlertTitle}>
{strings('home_page.backup_alert_title')}
</Text>
<Text style={styles.backupAlertMessage}>
{strings('home_page.backup_alert_message')}
</Text>
</View>
</ElevatedView>
</TouchableOpacity>
)}
{this.props.passwordSet && !this.props.seedphraseBackedUp && (
<TouchableOpacity style={styles.backupAlert} onPress={this.backupAlertPress}>
<ElevatedView elevation={4} style={styles.backupAlertWrapper}>
<View style={styles.backupAlertIconWrapper}>
<Icon name="info-outline" style={styles.backupAlertIcon} />
</View>
<View>
<Text style={styles.backupAlertTitle}>{strings('home_page.backup_alert_title')}</Text>
<Text style={styles.backupAlertMessage}>
{strings('home_page.backup_alert_message')}
</Text>
</View>
</ElevatedView>
</TouchableOpacity>
)}
</View>
);
}

@ -91,10 +91,11 @@ const metamask_name = require('../../../images/metamask-name.png'); // eslint-di
* @returns {Object} - Corresponding navbar options containing headerTitle, headerLeft, headerTruncatedBackTitle and headerRight
*/
export default function getNavbarOptions(title, navigation) {
const onPress = () => {
function onPress() {
Keyboard.dismiss();
navigation.openDrawer();
};
}
return {
headerTitle: <NavbarTitle title={title} />,
headerLeft: (
@ -295,10 +296,14 @@ export function getWalletNavbarOptions(title, navigation) {
}
};
function openDrawer() {
navigation.openDrawer();
}
return {
headerTitle: <NavbarTitle title={title} />,
headerLeft: (
<TouchableOpacity onPress={() => navigation.openDrawer()} style={styles.backButton}>
<TouchableOpacity onPress={openDrawer} style={styles.backButton}>
<IonicIcon
name={Platform.OS === 'android' ? 'md-menu' : 'ios-menu'}
size={Platform.OS === 'android' ? 24 : 28}

@ -36,7 +36,7 @@ exports[`NetworkList should render correctly 1`] = `
Networks
</Text>
</View>
<ScrollView
<ScrollViewMock
style={
Object {
"flex": 1,
@ -429,7 +429,7 @@ exports[`NetworkList should render correctly 1`] = `
</Text>
</View>
</TouchableOpacity>
</ScrollView>
</ScrollViewMock>
<View
style={
Object {

@ -9,7 +9,7 @@ exports[`PhishingModal should render correctly 1`] = `
}
}
>
<Component
<Image
resizeMethod="auto"
source={
Object {
@ -70,7 +70,7 @@ exports[`PhishingModal should render correctly 1`] = `
Ethereum Phishing Detection
</Text>
</View>
<ScrollView
<ScrollViewMock
contentContainerStyle={
Object {
"paddingBottom": 20,
@ -199,7 +199,7 @@ exports[`PhishingModal should render correctly 1`] = `
please file an issue.
</Text>
</Text>
</ScrollView>
</ScrollViewMock>
</View>
<View
style={

@ -192,7 +192,7 @@ exports[`SignatureRequest should render correctly 1`] = `
}
}
>
<KeyboardAwareScrollView
<KeyboardAwareScrollViewMock
enableAutomaticScroll={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}

@ -278,6 +278,7 @@ exports[`TransactionEdit should render correctly 1`] = `
multiline={true}
onChangeText={[Function]}
placeholder="Optional"
rejectResponderTermination={true}
style={
Object {
"backgroundColor": "#FFFFFF",

@ -61,6 +61,10 @@ class TransactionEditor extends Component {
* Object containing accounts balances
*/
contractBalances: PropTypes.object,
/**
* String containing the selected address
*/
selectedAddress: PropTypes.string,
/**
* Action that sets transaction attributes from object to a transaction
*/

@ -54,7 +54,7 @@ export const TransactionNotification = props => {
}
} = props;
// eslint-disable-next-line no-undef
// eslint-disable-next-line
_getIcon = () => {
switch (type) {
case 'pending':

@ -88,6 +88,7 @@ exports[`TransactionReviewData should render correctly 1`] = `
editable={false}
multiline={true}
placeholder="Optional"
rejectResponderTermination={true}
style={
Object {
"backgroundColor": "#FFFFFF",

@ -141,9 +141,11 @@ class UrlAutocomplete extends Component {
<View style={styles.wrapper}>
{this.state.results.slice(0, 3).map(r => {
const { url, name } = r;
const onSubmit = () => {
function onSubmit() {
this.props.onSubmit(url);
};
}
return (
<TouchableOpacity containerStyle={styles.item} onPress={onSubmit} key={url}>
<View style={styles.itemWrapper}>

@ -11,7 +11,7 @@ exports[`WebsiteIcon should render correctly 1`] = `
}
useNativeDriver={true}
>
<Component
<Image
onError={[Function]}
source={
Object {

@ -9,7 +9,7 @@ exports[`AccountBackupStep1 should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
contentContainerStyle={
Object {
"flex": 1,
@ -276,6 +276,6 @@ exports[`AccountBackupStep1 should render correctly 1`] = `
</Button>
</View>
</View>
</ScrollView>
</ScrollViewMock>
</SafeAreaView>
`;

@ -9,7 +9,7 @@ exports[`AccountBackupStep2 should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
contentContainerStyle={
Object {
"flex": 1,
@ -182,6 +182,6 @@ exports[`AccountBackupStep2 should render correctly 1`] = `
</StyledButton>
</View>
</View>
</ScrollView>
</ScrollViewMock>
</SafeAreaView>
`;

@ -9,7 +9,7 @@ exports[`AccountBackupStep3 should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
contentContainerStyle={
Object {
"flex": 1,
@ -145,6 +145,6 @@ exports[`AccountBackupStep3 should render correctly 1`] = `
</StyledButton>
</View>
</View>
</ScrollView>
</ScrollViewMock>
</SafeAreaView>
`;

@ -9,7 +9,7 @@ exports[`AccountBackupStep4 should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
contentContainerStyle={
Object {
"flex": 1,
@ -448,6 +448,6 @@ exports[`AccountBackupStep4 should render correctly 1`] = `
</StyledButton>
</View>
</View>
</ScrollView>
</ScrollViewMock>
</SafeAreaView>
`;

@ -9,7 +9,7 @@ exports[`AccountBackupStep5 should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
style={
Object {
"backgroundColor": "#FFFFFF",
@ -995,6 +995,6 @@ exports[`AccountBackupStep5 should render correctly 1`] = `
This was to ensure you follow this security measure
</Text>
</CustomAlert>
</ScrollView>
</ScrollViewMock>
</SafeAreaView>
`;

@ -13,7 +13,7 @@ exports[`AccountBackupStep6 should render correctly 1`] = `
pages={5}
selected={5}
/>
<ScrollView
<ScrollViewMock
contentContainerStyle={
Object {
"flex": 1,
@ -36,7 +36,7 @@ exports[`AccountBackupStep6 should render correctly 1`] = `
}
}
>
<Component
<Image
resizeMethod="auto"
source={
Object {
@ -300,6 +300,6 @@ exports[`AccountBackupStep6 should render correctly 1`] = `
You are all backed up and ready to go!
</Text>
</CustomAlert>
</ScrollView>
</ScrollViewMock>
</SafeAreaView>
`;

@ -45,6 +45,7 @@ exports[`AddBookmark should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder=""
rejectResponderTermination={true}
returnKeyType="next"
style={
Object {
@ -91,6 +92,7 @@ exports[`AddBookmark should render correctly 1`] = `
allowFontScaling={true}
onChangeText={[Function]}
placeholder=""
rejectResponderTermination={true}
returnKeyType="done"
style={
Object {

@ -8,7 +8,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
}
}
>
<KeyboardAwareScrollView
<KeyboardAwareScrollViewMock
enableAutomaticScroll={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}
@ -247,6 +247,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
onBlur={[Function]}
onChangeText={[Function]}
placeholder="New RPC Network"
rejectResponderTermination={true}
style={
Array [
Object {
@ -423,6 +424,6 @@ exports[`AdvancedSettings should render correctly 1`] = `
</StyledButton>
</View>
</View>
</KeyboardAwareScrollView>
</KeyboardAwareScrollViewMock>
</SafeAreaView>
`;

@ -38,7 +38,11 @@ class Approval extends Component {
/**
* Transaction state
*/
transaction: PropTypes.object.isRequired
transaction: PropTypes.object.isRequired,
/**
* List of transactions
*/
transactions: PropTypes.array
};
state = {

@ -95,6 +95,7 @@ exports[`Browser should render correctly 1`] = `
onSubmitEditing={[Function]}
placeholder="Enter website address"
placeholderTextColor="#747d8c"
rejectResponderTermination={true}
returnKeyType="go"
selectTextOnFocus={true}
style={

@ -18,7 +18,7 @@ exports[`ChoosePassword should render correctly 1`] = `
}
testID="choose-password-screen"
>
<KeyboardAwareScrollView
<KeyboardAwareScrollViewMock
enableAutomaticScroll={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}
@ -136,6 +136,7 @@ exports[`ChoosePassword should render correctly 1`] = `
onFocus={[Function]}
onSubmitEditing={[Function]}
placeholder=""
rejectResponderTermination={true}
returnKeyType="next"
secureTextEntry={true}
style={
@ -244,6 +245,7 @@ exports[`ChoosePassword should render correctly 1`] = `
onFocus={[Function]}
onSubmitEditing={[Function]}
placeholder=""
rejectResponderTermination={true}
returnKeyType="done"
secureTextEntry={true}
style={
@ -328,7 +330,7 @@ exports[`ChoosePassword should render correctly 1`] = `
/>
</View>
</View>
</KeyboardAwareScrollView>
</KeyboardAwareScrollViewMock>
<View
style={
Object {

@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import {
Animated,
Switch,
AsyncStorage,
ActivityIndicator,
Alert,
Text,
@ -15,6 +14,7 @@ import {
TouchableOpacity
} from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import AsyncStorage from '@react-native-community/async-storage';
import { connect } from 'react-redux';
import { passwordSet } from '../../../actions/user';
import StyledButton from '../../UI/StyledButton';

@ -9,7 +9,7 @@ exports[`Collectible should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
refreshControl={
<RefreshControlMock
onRefresh={[Function]}
@ -72,7 +72,7 @@ exports[`Collectible should render correctly 1`] = `
/>
</View>
</View>
</ScrollView>
</ScrollViewMock>
<ReactNativeModal
animationIn="slideInUp"
animationInTiming={300}

@ -9,7 +9,7 @@ exports[`CollectibleView should render correctly 1`] = `
}
}
>
<ScrollView
<ScrollViewMock
style={
Object {
"flex": 0.9,
@ -36,7 +36,7 @@ exports[`CollectibleView should render correctly 1`] = `
}
/>
</View>
</ScrollView>
</ScrollViewMock>
<View
style={
Object {

@ -8,9 +8,9 @@ import {
Text,
View,
ScrollView,
StyleSheet,
AsyncStorage
StyleSheet
} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import { colors, fontStyles } from '../../../styles/common';
import AnimatedFox from 'react-native-animated-fox';
import { strings } from '../../../../locales/i18n';

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { AsyncStorage } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import Engine from '../../../core/Engine';
import FoxScreen from '../../UI/FoxScreen';
import SecureKeychain from '../../../core/SecureKeychain';

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`GeneralSettings should render correctly 1`] = `
<ScrollView
<ScrollViewMock
style={
Object {
"backgroundColor": "#FFFFFF",
@ -463,5 +463,5 @@ exports[`GeneralSettings should render correctly 1`] = `
/>
</View>
</View>
</ScrollView>
</ScrollViewMock>
`;

@ -9,7 +9,7 @@ exports[`ImportFromSeed should render correctly 1`] = `
}
}
>
<KeyboardAwareScrollView
<KeyboardAwareScrollViewMock
enableAutomaticScroll={true}
enableOnAndroid={false}
enableResetScrollToCoords={true}
@ -60,6 +60,7 @@ exports[`ImportFromSeed should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder="Enter your seed phrase here"
rejectResponderTermination={true}
returnKeyType="next"
style={
Array [
@ -110,6 +111,7 @@ exports[`ImportFromSeed should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder=""
rejectResponderTermination={true}
returnKeyType="next"
secureTextEntry={true}
style={
@ -152,6 +154,7 @@ exports[`ImportFromSeed should render correctly 1`] = `
onChangeText={[Function]}
onSubmitEditing={[Function]}
placeholder=""
rejectResponderTermination={true}
returnKeyType="done"
<