diff --git a/.eslintrc.js b/.eslintrc.js index bec142f26..e0a458bc5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,6 +25,12 @@ module.exports = { 'no-console': 'off', "max-len": ["error", { "code": 250, "ignoreComments": true }], "complexity": "warn", + "camelcase": [ + "error", { + "ignoreDestructuring": true, + "allow": [ "^UNSAFE_" ] + } + ], }, "parser": "@babel/eslint-parser", }; diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 963a2b9b3..e6ba1c193 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -6,7 +6,8 @@ + tools:ignore="GoogleAppIndexingWarning" + android:usesCleartextTraffic="true" > diff --git a/ios/Podfile b/ios/Podfile index 7b0aee16b..5c198e7f6 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -20,6 +20,5 @@ target 'rwallet' do #post_install do |installer| # react_native_post_install(installer) #end - pod 'RNReanimated', :path => '../node_modules/react-native-reanimated' end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a194536bb..97b1f4e28 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -285,6 +285,8 @@ PODS: - React-Core - react-native-randombytes (3.6.1): - React-Core + - react-native-safe-area-context (3.2.0): + - React-Core - react-native-segmented-control (2.2.2): - React-Core - react-native-slider (3.0.3): @@ -386,6 +388,35 @@ PODS: - React - RNOS (1.2.6): - React + - RNReanimated (2.2.0): + - DoubleConversion + - FBLazyVector + - FBReactNativeSpec + - glog + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React + - React-callinvoker + - React-Core + - React-Core/DevSupport + - React-Core/RCTWebSocket + - React-CoreModules + - React-cxxreact + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-RCTActionSheet + - React-RCTAnimation + - React-RCTBlob + - React-RCTImage + - React-RCTLinking + - React-RCTNetwork + - React-RCTSettings + - React-RCTText + - React-RCTVibration + - ReactCommon/turbomodule/core + - Yoga - RNScreens (1.0.0-alpha.23): - React - RNSecureStorage (1.0.82): @@ -426,6 +457,7 @@ DEPENDENCIES: - react-native-notifications (from `../node_modules/react-native-notifications`) - react-native-pager-view (from `../node_modules/react-native-pager-view`) - react-native-randombytes (from `../node_modules/react-native-randombytes`) + - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - "react-native-segmented-control (from `../node_modules/@react-native-community/segmented-control`)" - "react-native-slider (from `../node_modules/@react-native-community/slider`)" - react-native-tcp-socket (from `../node_modules/react-native-tcp-socket`) @@ -454,6 +486,7 @@ DEPENDENCIES: - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNI18n (from `../node_modules/react-native-i18n`) - RNOS (from `../node_modules/react-native-os`) + - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) - RNSecureStorage (from `../node_modules/rn-secure-storage/ios`) - RNShare (from `../node_modules/react-native-share`) @@ -524,6 +557,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-pager-view" react-native-randombytes: :path: "../node_modules/react-native-randombytes" + react-native-safe-area-context: + :path: "../node_modules/react-native-safe-area-context" react-native-segmented-control: :path: "../node_modules/@react-native-community/segmented-control" react-native-slider: @@ -580,6 +615,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-i18n" RNOS: :path: "../node_modules/react-native-os" + RNReanimated: + :path: "../node_modules/react-native-reanimated" RNScreens: :path: "../node_modules/react-native-screens" RNSecureStorage: @@ -631,6 +668,7 @@ SPEC CHECKSUMS: react-native-notifications: 51ed8167f70f01c5000ba81a4465ea98b4612e23 react-native-pager-view: 2864530d861ab2970beb2cd0b4cf2292cd30cd84 react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846 + react-native-safe-area-context: f0906bf8bc9835ac9a9d3f97e8bde2a997d8da79 react-native-segmented-control: 65df6cd0619b780b3843d574a72d4c7cec396097 react-native-slider: e99fc201cefe81270fc9d81714a7a0f5e566b168 react-native-tcp-socket: d05b8acbf1c045ff5b6a92ec6ca91960c94387d1 @@ -659,6 +697,7 @@ SPEC CHECKSUMS: RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 RNI18n: e2f7e76389fcc6e84f2c8733ea89b92502351fd8 RNOS: 6f2f9a70895bbbfbdad7196abd952e7b01d45027 + RNReanimated: 9c13c86454bfd54dab7505c1a054470bfecd2563 RNScreens: f28b48b8345f2f5f39ed6195518291515032a788 RNSecureStorage: 8b2b07278d80c48b3a881c56e604ab147372f243 RNShare: 5ac8f6532ca4cd80fc71caef1cfbba1854a6a045 @@ -667,6 +706,6 @@ SPEC CHECKSUMS: toolbar-android: 85f3ef4d691469f2d304e7dee4bca013aa1ba1ff Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac -PODFILE CHECKSUM: 878d082ef86a1c6cd9f6bf6f19aa97ee4faaecfe +PODFILE CHECKSUM: 11f5efe97362fdba08554285a01bb8baf137c2b4 COCOAPODS: 1.10.1 diff --git a/src/components/common/inapp.notification/notification.js b/src/components/common/inapp.notification/notification.js index 918443008..c37ef366c 100644 --- a/src/components/common/inapp.notification/notification.js +++ b/src/components/common/inapp.notification/notification.js @@ -29,7 +29,7 @@ class Notification extends Component { }; } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { const { isVisiable, notification, resetInAppNotification } = nextProps; const { isVisiable: lastIsVisiable } = this.props; if (isVisiable !== lastIsVisiable && isVisiable) { @@ -104,6 +104,7 @@ class Notification extends Component { Animated.timing(animatedValue, { toValue: 1, duration: openCloseDuration, + useNativeDriver: true, }).start(done); } @@ -113,10 +114,10 @@ class Notification extends Component { Animated.timing(animatedValue, { toValue: 0, duration: openCloseDuration, + useNativeDriver: true, }).start(done); } - onPressed = () => { const { processNotification } = this.props; const { notification } = this; diff --git a/src/components/common/notification/toast.js b/src/components/common/notification/toast.js index 44151c7fa..2a1440725 100644 --- a/src/components/common/notification/toast.js +++ b/src/components/common/notification/toast.js @@ -55,6 +55,7 @@ class Toast extends Component { { toValue: 10, duration: 350, + useNativeDriver: true, }, ), @@ -63,6 +64,7 @@ class Toast extends Component { { toValue: 0, duration: 350, + useNativeDriver: true, }, ), ]).start(() => { @@ -87,6 +89,7 @@ class Toast extends Component { { toValue: 0, duration: 350, + useNativeDriver: true, }, ), @@ -95,6 +98,7 @@ class Toast extends Component { { toValue: 1, duration: 350, + useNativeDriver: true, }, ), ]).start(this.hideToast(duration)); diff --git a/src/pages/dapp/index.js b/src/pages/dapp/index.js index 4f562b5e2..2e95bbe4c 100644 --- a/src/pages/dapp/index.js +++ b/src/pages/dapp/index.js @@ -11,7 +11,8 @@ import { PlaceholderMedia, } from 'rn-placeholder'; import { connect } from 'react-redux'; -import { NavigationEvents, Header as NavHeader } from 'react-navigation'; +import { NavigationEvents } from 'react-navigation'; +import { Header as NavHeader } from 'react-navigation-stack'; import BasePageGereral from '../base/base.page.general'; import { strings } from '../../common/i18n'; import SearchInput from '../../components/common/input/searchInput'; @@ -143,7 +144,7 @@ class DAppIndex extends Component { fetchAdvertisements(); } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { const { language, fetchDapps } = this.props; // reload dapp page when language changed @@ -394,7 +395,7 @@ DAppIndex.propTypes = { navigate: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired, goBack: PropTypes.func.isRequired, - state: PropTypes.object.isRequired, + state: PropTypes.shape({}).isRequired, }).isRequired, fetchDapps: PropTypes.func.isRequired, fetchAdvertisements: PropTypes.func.isRequired, diff --git a/src/pages/start/term.row.js b/src/pages/start/term.row.js index 92879ab33..b35958e92 100644 --- a/src/pages/start/term.row.js +++ b/src/pages/start/term.row.js @@ -47,6 +47,7 @@ export default class TermRow extends Component { toValue: 1, duration: 1000, delay: delay * 1000, + useNativeDriver: true, }).start(); } diff --git a/src/pages/wallet/verify.phrase.js b/src/pages/wallet/verify.phrase.js index 55260d613..757d3ff65 100644 --- a/src/pages/wallet/verify.phrase.js +++ b/src/pages/wallet/verify.phrase.js @@ -148,7 +148,7 @@ class VerifyPhrase extends Component { this.renderConfirmation = this.renderConfirmation.bind(this); } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { const { navigation, isWalletsUpdated } = nextProps; const { isLoading } = this.state; // isWalletsUpdated is true indicates wallet is added, the app will navigate to other page. @@ -234,6 +234,7 @@ class VerifyPhrase extends Component { { toValue: offset, duration: 300, + useNativeDriver: true, }, ).start(() => { this.setState({ isAnimating: true }); @@ -373,7 +374,14 @@ VerifyPhrase.propTypes = { navigate: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired, goBack: PropTypes.func.isRequired, - state: PropTypes.object.isRequired, + state: PropTypes.shape({ + params: PropTypes.shape({ + phrase: PropTypes.shape({ + split: PropTypes.string, + }), + coins: PropTypes.arrayOf(PropTypes.shape({})), + }).isRequired, + }).isRequired, }).isRequired, walletManager: PropTypes.shape({}), addNotification: PropTypes.func.isRequired,