From bb34ebb0ff9fda487223889e76a796841b4ee749 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 12 Nov 2019 21:38:13 -0500 Subject: [PATCH 1/5] use v8 instead of JSC --- android/app/build.gradle | 10 ++---- android/build.gradle | 13 +++++--- package.json | 5 ++- yarn.lock | 66 ++++++++++++++++++++++++++++++---------- 4 files changed, 64 insertions(+), 30 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 781c6c424bd..b05f0061084 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -215,11 +215,6 @@ android { } } - packagingOptions { - pickFirst 'lib/x86_64/libjsc.so' - pickFirst 'lib/arm64-v8a/libjsc.so' - } - buildTypes { debug { manifestPlaceholders = [isDebug:true] @@ -236,8 +231,8 @@ android { } packagingOptions { - pickFirst 'lib/x86_64/libjsc.so' - pickFirst 'lib/arm64-v8a/libjsc.so' + // Make sure libjsc.so does not packed in APK + exclude "**/libjsc.so" } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> @@ -272,6 +267,7 @@ dependencies { implementation 'androidx.annotation:annotation:1.0.0' implementation 'androidx.appcompat:appcompat:1.0.0' implementation "com.facebook.react:react-native:+" // From node_modules + implementation 'org.chromium:v8-android:7.8.+' implementation project(':react-native-branch') implementation "io.branch.sdk.android:library:4.1.2" diff --git a/android/build.gradle b/android/build.gradle index 588a9108c82..7e54b85bcdf 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -28,11 +28,16 @@ allprojects { mavenLocal() google() jcenter() - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$rootDir/../node_modules/react-native/android" + maven { // Replace AAR from original RN with AAR from react-native-v8 + url("$rootDir/../node_modules/react-native-v8/dist") } - maven { url "https://jitpack.io" } + maven { + // prebuilt libv8android.so + url("$rootDir/../node_modules/v8-android/dist") + } + maven { + url "https://jitpack.io" + } } subprojects { diff --git a/package.json b/package.json index 6f75863f4ef..3712a38ddbf 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,6 @@ "fuse.js": "3.4.4", "gaba": "1.8.2", "https-browserify": "0.0.1", - "jsc-android": "236355.1.1", "lottie-react-native": "git+ssh://git@github.com/brunobar79/lottie-react-native.git#7ce6a78ac4ac7b9891bc513cb3f12f8b9c9d9106", "multihashes": "0.4.14", "number-to-bn": "1.7.0", @@ -120,15 +119,15 @@ "react-native-qrcode-svg": "5.1.2", "react-native-randombytes": "3.5.2", "react-native-reanimated": "1.3.0", - "react-native-remote-svg": "git+ssh://git@github.com/brunobar79/react-native-remote-svg.git#6f071a1cefe25e9a9d56570a74523741bae65a8b", "react-native-screens": "1.0.0-alpha.23", "react-native-scrollable-tab-view": "git+ssh://git@github.com/estebanmino/react-native-scrollable-tab-view.git#f954274c6260a07c956e2185c611aed24b2f1526", "react-native-search-api": "1.2.0", "react-native-sensors": "5.3.0", "react-native-share": "git+ssh://git@github.com/brunobar79/react-native-share.git#androidx", - "react-native-svg": "9.3.3", + "react-native-svg": "9.13.3", "react-native-swipe-gestures": "1.0.3", "react-native-tcp": "3.3.0", + "react-native-v8": "0.59.10-patch.4", "react-native-vector-icons": "6.4.2", "react-native-view-shot": "git+ssh://git@github.com/brunobar79/react-native-view-shot.git#androidx", "react-native-webview": "git+ssh://git@github.com/brunobar79/react-native-webview.git#1ba21595a484e2713319a54e01aa78743fe92f56", diff --git a/yarn.lock b/yarn.lock index 9ae76544262..fce4de9bfae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1878,7 +1878,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4 resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== -boolbase@~1.0.0: +boolbase@^1.0.0, boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= @@ -2663,6 +2663,16 @@ crypto-js@^3.1.4: resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.8.tgz#715f070bf6014f2ae992a98b3929258b713f08d5" integrity sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU= +css-select@^2.0.2: + version "2.1.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-2.1.0.tgz#6a34653356635934a81baca68d0255432105dbef" + integrity sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ== + dependencies: + boolbase "^1.0.0" + css-what "^3.2.1" + domutils "^1.7.0" + nth-check "^1.0.2" + css-select@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" @@ -2673,11 +2683,24 @@ css-select@~1.2.0: domutils "1.5.1" nth-check "~1.0.1" +css-tree@^1.0.0-alpha.37: + version "1.0.0-alpha.37" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.37.tgz#98bebd62c4c1d9f960ec340cf9f7522e30709a22" + integrity sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg== + dependencies: + mdn-data "2.0.4" + source-map "^0.6.1" + css-what@2.1: version "2.1.3" resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== +css-what@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.2.1.tgz#f4a8f12421064621b456755e34a03a2c22df5da1" + integrity sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw== + cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -3044,7 +3067,7 @@ domutils@1.5.1: dom-serializer "0" domelementtype "1" -domutils@^1.5.1: +domutils@^1.5.1, domutils@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== @@ -6184,11 +6207,6 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -jsc-android@236355.1.1: - version "236355.1.1" - resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-236355.1.1.tgz#43e153b722e3c60dd0595be4e7430baf65e67c9c" - integrity sha512-2py4f0McZIl/oH6AzPj1Ebutc58fyeLvwq6gyVYp1RsWr4qeLNHAPfW3kmfeVMz44oUBJMQ0lECZg9n4KBhHbQ== - jsdom@^11.5.1: version "11.12.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" @@ -6827,6 +6845,11 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +mdn-data@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" + integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== + mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" @@ -7867,7 +7890,7 @@ npmlog@^4.0.2: gauge "~2.7.3" set-blocking "~2.0.0" -nth-check@~1.0.1: +nth-check@^1.0.2, nth-check@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== @@ -9074,10 +9097,6 @@ react-native-reanimated@1.3.0: resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-1.3.0.tgz#581cdb0bd1ff05e7304b116af712ded0c7665ede" integrity sha512-KFno6D0q09kx71IDuPa4qeC1t1msALsCMuli3/EN3YDf8XoM2CG53yzhVHMFtmcW0IUCySugHgxQiuT5BzwOPA== -"react-native-remote-svg@git+ssh://git@github.com/brunobar79/react-native-remote-svg.git#6f071a1cefe25e9a9d56570a74523741bae65a8b": - version "2.0.6" - resolved "git+ssh://git@github.com/brunobar79/react-native-remote-svg.git#6f071a1cefe25e9a9d56570a74523741bae65a8b" - react-native-safe-area-view@^0.14.1, react-native-safe-area-view@^0.14.6: version "0.14.8" resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.8.tgz#ef33c46ff8164ae77acad48c3039ec9c34873e5b" @@ -9123,10 +9142,13 @@ react-native-sensors@5.3.0: version "1.2.1" resolved "git+ssh://git@github.com/brunobar79/react-native-share.git#f6186e0c41d99674de2633d5e4d079f61fb9237c" -react-native-svg@9.3.3: - version "9.3.3" - resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-9.3.3.tgz#6e94b7d1e2eee1fad23e6af317be68d6db16e5a0" - integrity sha512-BpZnKk73M6VH56iE/+qNQObzhj2wvm2YlPDvT4Z9DTuMjCAnnktrfw5rGgW83dg21unyMGHwm9bvkwgDV975cA== +react-native-svg@9.13.3: + version "9.13.3" + resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-9.13.3.tgz#6414b337d55af169ac2487ab70f3108404434446" + integrity sha512-H50b2m4jvrQ7KxKs8uYSuWecr6e5XC7BDfS7DaA96+0Owjh0C9DksI5l8SRyHnmE+emiYMPu6Qqfr9dCyKkaJQ== + dependencies: + css-select "^2.0.2" + css-tree "^1.0.0-alpha.37" react-native-swipe-gestures@1.0.3: version "1.0.3" @@ -9157,6 +9179,13 @@ react-native-tcp@3.3.0: process "^0.11.9" util "^0.10.3" +react-native-v8@0.59.10-patch.4: + version "0.59.10-patch.4" + resolved "https://registry.yarnpkg.com/react-native-v8/-/react-native-v8-0.59.10-patch.4.tgz#6f32630a9badff5acb118c0a2820a76a88874431" + integrity sha512-dsiXdI1RSHf2tHlLjIPysI+Y2qK7T58vsjin5uLBKnYwfgU4C0ITQ/2wDTtTu/ukMm7aRVRwSB6dkX/KrsCyIw== + dependencies: + v8-android "7.8.x >= 7.8.1" + react-native-vector-icons@6.4.2: version "6.4.2" resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-6.4.2.tgz#ee0b097e783387544ed160a3192a437c097e551d" @@ -11098,6 +11127,11 @@ uuid@^3.0.1, uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== +"v8-android@7.8.x >= 7.8.1": + version "7.8.1" + resolved "https://registry.yarnpkg.com/v8-android/-/v8-android-7.8.1.tgz#2686c3fe655742bbd02e1b6d1c3e336365d4e8e0" + integrity sha512-fxqBNITrILwfzQI9ZIWHR44B6Hvhplfht+V9dpcTrm7CGZjWpUaD/n3C0ghCW15VLRYhWPuCVltXHwbvsBOLjw== + v8-compile-cache@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" From f4e07ed75182f7817a0cb4ea6244d6af847da3b9 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 12 Nov 2019 21:38:30 -0500 Subject: [PATCH 2/5] replace react-native-remote-svg for react-native-svg --- app/components/Base/RemoteImage/index.js | 41 +++++++++++++++++++++ app/components/UI/AccountList/index.js | 25 ++++++++----- app/components/UI/AssetIcon/index.js | 4 +- app/components/UI/CollectibleImage/index.js | 9 ++--- app/components/UI/DrawerView/index.js | 5 +-- 5 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 app/components/Base/RemoteImage/index.js diff --git a/app/components/Base/RemoteImage/index.js b/app/components/Base/RemoteImage/index.js new file mode 100644 index 00000000000..9acd1784170 --- /dev/null +++ b/app/components/Base/RemoteImage/index.js @@ -0,0 +1,41 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { Image, ViewPropTypes } from 'react-native'; +import FadeIn from 'react-native-fade-in-image'; +// eslint-disable-next-line import/default +import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource'; +import { SvgCssUri } from 'react-native-svg'; + +const RemoteImage = props => { + const source = resolveAssetSource(props.source); + if (source && (source.uri && source.uri.match('.svg'))) { + const style = props.style || {}; + if (source.__packager_asset && typeof style !== 'number') { + if (!style.width) { + style.width = source.width; + } + if (!style.height) { + style.height = source.height; + } + } + return ; + } + + if (props.fadeIn) { + return ( + + + + ); + } + return ; +}; + +RemoteImage.propTypes = { + fadeIn: PropTypes.bool, + source: PropTypes.any, + style: ViewPropTypes.style, + placeholderStyle: ViewPropTypes.style +}; + +export default RemoteImage; diff --git a/app/components/UI/AccountList/index.js b/app/components/UI/AccountList/index.js index f0c9dfa7b2b..64c39c48513 100644 --- a/app/components/UI/AccountList/index.js +++ b/app/components/UI/AccountList/index.js @@ -119,12 +119,13 @@ class AccountList extends PureComponent { const { identities, selectedAddress } = this.props; Object.keys(identities).forEach((address, i) => { if (selectedAddress === address) { - this.setState({ selectedAccountIndex: i }); + this.mounted && this.setState({ selectedAccountIndex: i }); } }); }; componentDidMount() { + this.mounted = true; this.getInitialSelectedAccountIndex(); const orderedAccounts = this.getAccounts(); InteractionManager.runAfterInteractions(() => { @@ -132,9 +133,13 @@ class AccountList extends PureComponent { this.scrollToCurrentAccount(); } }); - this.setState({ orderedAccounts }); + this.mounted && this.setState({ orderedAccounts }); } + componentWillUnmount = () => { + this.mounted = false; + }; + scrollToCurrentAccount() { this.flatList && this.flatList.current && @@ -147,7 +152,7 @@ class AccountList extends PureComponent { const { keyrings } = this.props; requestAnimationFrame(async () => { try { - this.setState({ selectedAccountIndex: newIndex }); + this.mounted && this.setState({ selectedAccountIndex: newIndex }); const allKeyrings = keyrings && keyrings.length ? keyrings : Engine.context.KeyringController.state.keyrings; @@ -164,7 +169,7 @@ class AccountList extends PureComponent { }); } catch (e) { // Restore to the previous index in case anything goes wrong - this.setState({ selectedAccountIndex: previousIndex }); + this.mounted && this.setState({ selectedAccountIndex: previousIndex }); Logger.error('error while trying change the selected account', e); // eslint-disable-line } InteractionManager.runAfterInteractions(() => { @@ -173,7 +178,7 @@ class AccountList extends PureComponent { }, 1000); }); const orderedAccounts = this.getAccounts(); - await this.setState({ orderedAccounts }); + this.mounted && this.setState({ orderedAccounts }); }); }; @@ -183,7 +188,7 @@ class AccountList extends PureComponent { addAccount = async () => { if (this.state.loading) return; - this.setState({ loading: true }); + this.mounted && this.setState({ loading: true }); const { KeyringController } = Engine.context; requestAnimationFrame(async () => { try { @@ -191,17 +196,17 @@ class AccountList extends PureComponent { const { PreferencesController } = Engine.context; const newIndex = Object.keys(this.props.identities).length - 1; PreferencesController.setSelectedAddress(Object.keys(this.props.identities)[newIndex]); - this.setState({ selectedAccountIndex: newIndex }); + this.mounted && this.setState({ selectedAccountIndex: newIndex }); setTimeout(() => { this.flatList && this.flatList.current && this.flatList.current.scrollToEnd(); - this.setState({ loading: false }); + this.mounted && this.setState({ loading: false }); }, 500); const orderedAccounts = this.getAccounts(); - await this.setState({ orderedAccounts }); + this.mounted && this.setState({ orderedAccounts }); } catch (e) { // Restore to the previous index in case anything goes wrong Logger.error('error while trying to add a new account', e); // eslint-disable-line - this.setState({ loading: false }); + this.mounted && this.setState({ loading: false }); } }); }; diff --git a/app/components/UI/AssetIcon/index.js b/app/components/UI/AssetIcon/index.js index 999132578fb..c3b56ba320a 100644 --- a/app/components/UI/AssetIcon/index.js +++ b/app/components/UI/AssetIcon/index.js @@ -1,6 +1,6 @@ import React from 'react'; import { StyleSheet } from 'react-native'; -import Image from 'react-native-remote-svg'; +import RemoteImage from '../../Base/RemoteImage'; import PropTypes from 'prop-types'; import getAssetLogoPath from '../../../util/assets'; import { colors } from '../../../styles/common'; @@ -20,7 +20,7 @@ const AssetIcon = React.memo(props => { if (!props.logo) return null; const uri = props.watchedAsset ? props.logo : getAssetLogoPath(props.logo); const style = [styles.logo, props.customStyle]; - return ; + return ; }); AssetIcon.propTypes = { diff --git a/app/components/UI/CollectibleImage/index.js b/app/components/UI/CollectibleImage/index.js index 72a277657a4..b060ef57b4d 100644 --- a/app/components/UI/CollectibleImage/index.js +++ b/app/components/UI/CollectibleImage/index.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { StyleSheet, View, Image } from 'react-native'; -import SvgImage from 'react-native-remote-svg'; +import { StyleSheet, View } from 'react-native'; +import RemoteImage from '../../Base/RemoteImage'; import Identicon from '../Identicon'; import { colors } from '../../../styles/common'; @@ -66,13 +66,10 @@ export default class CollectibleImage extends PureComponent { iconStyle } = this.props; - const isSVG = image && image.substr(-3) === 'svg'; - const ImageComponent = isSVG ? SvgImage : Image; - return ( {image && image.length !== 0 ? ( - , - selectedIcon: , + icon: , + selectedIcon: , action: this.goToPaymentChannel }, { From 7cf742facf5661f9e18023c29bc8c40b51967f50 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 12 Nov 2019 21:41:55 -0500 Subject: [PATCH 3/5] fix svg size --- app/components/Base/RemoteImage/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/components/Base/RemoteImage/index.js b/app/components/Base/RemoteImage/index.js index 9acd1784170..78422fdbe41 100644 --- a/app/components/Base/RemoteImage/index.js +++ b/app/components/Base/RemoteImage/index.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Image, ViewPropTypes } from 'react-native'; +import { View, Image, ViewPropTypes } from 'react-native'; import FadeIn from 'react-native-fade-in-image'; // eslint-disable-next-line import/default import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource'; @@ -18,7 +18,11 @@ const RemoteImage = props => { style.height = source.height; } } - return ; + return ( + + + + ); } if (props.fadeIn) { From 7325d5f5be67bd795f685ec049a2f17e06fa4ec2 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 12 Nov 2019 22:15:42 -0500 Subject: [PATCH 4/5] update snapshots --- .../__snapshots__/index.test.js.snap | 18 ++++++++++++++++++ app/components/Base/RemoteImage/index.test.js | 16 ++++++++++++++++ .../AssetIcon/__snapshots__/index.test.js.snap | 2 +- .../__snapshots__/index.test.js.snap | 2 +- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 app/components/Base/RemoteImage/__snapshots__/index.test.js.snap create mode 100644 app/components/Base/RemoteImage/index.test.js diff --git a/app/components/Base/RemoteImage/__snapshots__/index.test.js.snap b/app/components/Base/RemoteImage/__snapshots__/index.test.js.snap new file mode 100644 index 00000000000..1ebf34b1d05 --- /dev/null +++ b/app/components/Base/RemoteImage/__snapshots__/index.test.js.snap @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`RemoteImage should render correctly 1`] = ` + + + +`; diff --git a/app/components/Base/RemoteImage/index.test.js b/app/components/Base/RemoteImage/index.test.js new file mode 100644 index 00000000000..588b3bb5a71 --- /dev/null +++ b/app/components/Base/RemoteImage/index.test.js @@ -0,0 +1,16 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import RemoteImage from './'; + +describe('RemoteImage', () => { + it('should render correctly', () => { + const wrapper = shallow( + + ); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/app/components/UI/AssetIcon/__snapshots__/index.test.js.snap b/app/components/UI/AssetIcon/__snapshots__/index.test.js.snap index af7b1ff88d4..698efef9c95 100644 --- a/app/components/UI/AssetIcon/__snapshots__/index.test.js.snap +++ b/app/components/UI/AssetIcon/__snapshots__/index.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`AssetIcon should render correctly 1`] = ` - - Date: Tue, 12 Nov 2019 22:17:54 -0500 Subject: [PATCH 5/5] clean up --- android/app/build.gradle | 2 +- app/components/Base/RemoteImage/index.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index b05f0061084..902c9b797e2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -267,7 +267,7 @@ dependencies { implementation 'androidx.annotation:annotation:1.0.0' implementation 'androidx.appcompat:appcompat:1.0.0' implementation "com.facebook.react:react-native:+" // From node_modules - implementation 'org.chromium:v8-android:7.8.+' + implementation 'org.chromium:v8-android:7.8.+' implementation project(':react-native-branch') implementation "io.branch.sdk.android:library:4.1.2" diff --git a/app/components/Base/RemoteImage/index.js b/app/components/Base/RemoteImage/index.js index 78422fdbe41..4fc615a50b6 100644 --- a/app/components/Base/RemoteImage/index.js +++ b/app/components/Base/RemoteImage/index.js @@ -36,9 +36,21 @@ const RemoteImage = props => { }; RemoteImage.propTypes = { + /** + * Flag that determines the fade in behavior + */ fadeIn: PropTypes.bool, + /** + * Source of the image + */ source: PropTypes.any, + /** + * Style for the image + */ style: ViewPropTypes.style, + /** + * Style for the placeholder (used for fadeIn) + */ placeholderStyle: ViewPropTypes.style };