From ddf8a87fd3d88df1be5799aa2acb9cabc892c78c Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Mon, 18 Jan 2021 22:40:11 -0500 Subject: [PATCH 1/6] REF: Handoff Component --- ...ctivity.android.js => WatchConnectivity.js | 0 blue_modules/handoff.ios.js | 16 +++++++++++++ blue_modules/handoff.js | 5 ++++ blue_modules/storage-context.js | 20 ++++++++++++++++ class/app-storage.js | 1 + class/handoff.js | 24 ------------------- screen/receive/details.js | 9 +++---- screen/settings/GeneralSettings.js | 14 ++++------- screen/transactions/details.js | 17 +++++-------- screen/transactions/transactionStatus.js | 14 +++++------ screen/wallets/transactions.js | 9 +++---- 11 files changed, 65 insertions(+), 64 deletions(-) rename WatchConnectivity.android.js => WatchConnectivity.js (100%) create mode 100644 blue_modules/handoff.ios.js create mode 100644 blue_modules/handoff.js delete mode 100644 class/handoff.js diff --git a/WatchConnectivity.android.js b/WatchConnectivity.js similarity index 100% rename from WatchConnectivity.android.js rename to WatchConnectivity.js diff --git a/blue_modules/handoff.ios.js b/blue_modules/handoff.ios.js new file mode 100644 index 000000000..8800e6090 --- /dev/null +++ b/blue_modules/handoff.ios.js @@ -0,0 +1,16 @@ +import React, { useContext } from 'react'; +import Handoff from 'react-native-handoff'; +import { BlueStorageContext } from './storage-context'; +import PropTypes from 'prop-types'; + +const HandoffComponent = props => { + const { isHandOffUseEnabled } = useContext(BlueStorageContext); + + return isHandOffUseEnabled && props && props.url ? : null; +}; +HandoffComponent.STORAGE_KEY = 'HandOff'; +export default HandoffComponent; + +HandoffComponent.propTypes = { + url: PropTypes.string, +}; diff --git a/blue_modules/handoff.js b/blue_modules/handoff.js new file mode 100644 index 000000000..7d0b11d75 --- /dev/null +++ b/blue_modules/handoff.js @@ -0,0 +1,5 @@ +const HandoffComponent = () => { + return null; +}; + +export default HandoffComponent; diff --git a/blue_modules/storage-context.js b/blue_modules/storage-context.js index f8e4fa039..db0523500 100644 --- a/blue_modules/storage-context.js +++ b/blue_modules/storage-context.js @@ -18,6 +18,12 @@ export const BlueStorageProvider = ({ children }) => { const getPreferredCurrencyAsyncStorage = useAsyncStorage(AppStorage.PREFERRED_CURRENCY).getItem; const getLanguageAsyncStorage = useAsyncStorage(AppStorage.LANG).getItem; const [newWalletAdded, setNewWalletAdded] = useState(false); + const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false); + const setIsHandOffUseEnabledAsyncStorage = value => { + setIsHandOffUseEnabled(value); + return BlueApp.setItem(AppStorage.HANDOFF_STORAGE_KEY, value === true ? '1' : ''); + }; + const saveToDisk = async () => { BlueApp.tx_metadata = txMetadata; await BlueApp.saveToDisk(); @@ -29,6 +35,18 @@ export const BlueStorageProvider = ({ children }) => { setWallets(BlueApp.getWallets()); }, []); + useEffect(() => { + (async () => { + try { + const enabledHandoff = await BlueApp.getItem(AppStorage.HANDOFF_STORAGE_KEY); + setIsHandOffUseEnabled(!!enabledHandoff); + } catch (_e) { + setIsHandOffUseEnabledAsyncStorage(false); + setIsHandOffUseEnabled(false); + } + })(); + }, []); + const getPreferredCurrency = async () => { const item = await getPreferredCurrencyAsyncStorage(); _setPreferredFiatCurrency(item); @@ -187,6 +205,8 @@ export const BlueStorageProvider = ({ children }) => { preferredFiatCurrency, setLanguage, language, + isHandOffUseEnabled, + setIsHandOffUseEnabledAsyncStorage, }} > {children} diff --git a/class/app-storage.js b/class/app-storage.js index fbe2a04f3..8a2745ef2 100644 --- a/class/app-storage.js +++ b/class/app-storage.js @@ -35,6 +35,7 @@ export class AppStorage { static HODL_HODL_API_KEY = 'HODL_HODL_API_KEY'; static HODL_HODL_SIGNATURE_KEY = 'HODL_HODL_SIGNATURE_KEY'; static HODL_HODL_CONTRACTS = 'HODL_HODL_CONTRACTS'; + static HANDOFF_STORAGE_KEY = 'HandOff'; constructor() { /** {Array.} */ diff --git a/class/handoff.js b/class/handoff.js deleted file mode 100644 index 4bc73a418..000000000 --- a/class/handoff.js +++ /dev/null @@ -1,24 +0,0 @@ -import { Platform } from 'react-native'; - -const BlueApp = require('../BlueApp'); - -export default class HandoffSettings { - static STORAGEKEY = 'HandOff'; - - static async isHandoffUseEnabled() { - if (Platform.OS !== 'ios') { - return false; - } - try { - const enabledHandoff = await BlueApp.getItem(HandoffSettings.STORAGEKEY); - return !!enabledHandoff; - } catch (_e) { - await BlueApp.setItem(HandoffSettings.STORAGEKEY, ''); - return false; - } - } - - static async setHandoffUseEnabled(value) { - await BlueApp.setItem(HandoffSettings.STORAGEKEY, value === true && Platform.OS === 'ios' ? '1' : ''); - } -} diff --git a/screen/receive/details.js b/screen/receive/details.js index 4f6e9231a..b51baf739 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -13,7 +13,6 @@ import { import QRCode from 'react-native-qrcode-svg'; import { useNavigation, useRoute, useTheme, useFocusEffect } from '@react-navigation/native'; import Share from 'react-native-share'; -import Handoff from 'react-native-handoff'; import { BlueLoading, @@ -31,7 +30,7 @@ import navigationStyle from '../../components/navigationStyle'; import BottomModal from '../../components/BottomModal'; import Privacy from '../../Privacy'; import { Chain, BitcoinUnit } from '../../models/bitcoinUnits'; -import HandoffSettings from '../../class/handoff'; +import HandoffComponent from '../../blue_modules/handoff'; import DeeplinkSchemaMatch from '../../class/deeplink-schema-match'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; @@ -42,7 +41,6 @@ const ReceiveDetails = () => { const { walletID } = useRoute().params; const { wallets, saveToDisk, sleep } = useContext(BlueStorageContext); const wallet = wallets.find(w => w.getID() === walletID); - const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false); const [address, setAddress] = useState(''); const [customLabel, setCustomLabel] = useState(); const [customAmount, setCustomAmount] = useState(0); @@ -172,7 +170,6 @@ const ReceiveDetails = () => { }; const obtainWalletAddress = useCallback(async () => { - HandoffSettings.isHandoffUseEnabled().then(setIsHandOffUseEnabled); Privacy.enableBlur(); console.log('receive/details - componentDidMount'); wallet.setUserHasSavedExport(true); @@ -338,8 +335,8 @@ const ReceiveDetails = () => { return ( - {isHandOffUseEnabled && address !== undefined && showAddress && ( - { - const { isAdancedModeEnabled, setIsAdancedModeEnabled, wallets } = useContext(BlueStorageContext); + const { isAdancedModeEnabled, setIsAdancedModeEnabled, wallets, isHandOffUseEnabled, setIsHandOffUseEnabledAsyncStorage } = useContext( + BlueStorageContext, + ); const [isLoading, setIsLoading] = useState(true); const [isAdancedModeSwitchEnabled, setIsAdancedModeSwitchEnabled] = useState(false); - const [isHandoffUseEnabled, setIsHandoffUseEnabled] = useState(false); const { navigate } = useNavigation(); const { colors } = useTheme(); const onAdvancedModeSwitch = async value => { @@ -26,15 +26,9 @@ const GeneralSettings = () => { setIsAdancedModeSwitchEnabled(value); }; - const onHandOffEnabledSwitch = async value => { - await HandoffSettings.setHandoffUseEnabled(value); - setIsHandoffUseEnabled(value); - }; - useEffect(() => { (async () => { setIsAdancedModeSwitchEnabled(await isAdancedModeEnabled()); - setIsHandoffUseEnabled(await HandoffSettings.isHandoffUseEnabled()); setIsLoading(false); })(); }); @@ -69,7 +63,7 @@ const GeneralSettings = () => { hideChevron title={loc.settings.general_continuity} Component={TouchableWithoutFeedback} - switch={{ onValueChange: onHandOffEnabledSwitch, value: isHandoffUseEnabled }} + switch={{ onValueChange: setIsHandOffUseEnabledAsyncStorage, value: isHandOffUseEnabled }} /> {loc.settings.general_continuity_e} diff --git a/screen/transactions/details.js b/screen/transactions/details.js index 570fd552b..85febb9e7 100644 --- a/screen/transactions/details.js +++ b/screen/transactions/details.js @@ -2,10 +2,9 @@ import React, { useContext, useEffect, useState } from 'react'; import { View, ScrollView, TouchableOpacity, Text, TextInput, Linking, StatusBar, StyleSheet, Keyboard } from 'react-native'; import { useNavigation, useRoute, useTheme } from '@react-navigation/native'; -import Handoff from 'react-native-handoff'; import { BlueCard, BlueCopyToClipboardButton, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; -import HandoffSettings from '../../class/handoff'; +import HandoffComponent from '../../blue_modules/handoff'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; const dayjs = require('dayjs'); @@ -28,7 +27,6 @@ const TransactionsDetails = () => { const { setOptions } = useNavigation(); const { hash } = useRoute().params; const { saveToDisk, txMetadata, wallets, getTransactions } = useContext(BlueStorageContext); - const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false); const [from, setFrom] = useState(); const [to, setTo] = useState(); const [isLoading, setIsLoading] = useState(true); @@ -110,11 +108,6 @@ const TransactionsDetails = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [hash, wallets]); - useEffect(() => { - HandoffSettings.isHandoffUseEnabled().then(setIsHandOffUseEnabled); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const handleOnSaveButtonTapped = () => { Keyboard.dismiss(); txMetadata[tx.hash] = { memo }; @@ -136,9 +129,11 @@ const TransactionsDetails = () => { return ( - {isHandOffUseEnabled && ( - - )} + diff --git a/screen/transactions/transactionStatus.js b/screen/transactions/transactionStatus.js index 1269aba13..5b5a74352 100644 --- a/screen/transactions/transactionStatus.js +++ b/screen/transactions/transactionStatus.js @@ -1,7 +1,6 @@ import React, { useContext, useEffect, useRef, useState } from 'react'; import { View, ActivityIndicator, Text, TouchableOpacity, StyleSheet, StatusBar } from 'react-native'; import { Icon } from 'react-native-elements'; -import Handoff from 'react-native-handoff'; import { useNavigation, useRoute, useTheme } from '@react-navigation/native'; import { @@ -19,7 +18,7 @@ import { import navigationStyle from '../../components/navigationStyle'; import { HDSegwitBech32Transaction } from '../../class'; import { BitcoinUnit } from '../../models/bitcoinUnits'; -import HandoffSettings from '../../class/handoff'; +import HandoffComponent from '../../blue_modules/handoff'; import loc, { formatBalanceWithoutSuffix } from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; @@ -31,7 +30,6 @@ const buttonStatus = Object.freeze({ const TransactionsStatus = () => { const { setSelectedWallet, wallets, txMetadata, getTransactions } = useContext(BlueStorageContext); - const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false); const { hash } = useRoute().params; const { navigate, setOptions } = useNavigation(); const { colors } = useTheme(); @@ -127,7 +125,6 @@ const TransactionsStatus = () => { useEffect(() => { console.log('transactions/details - useEffect'); - HandoffSettings.isHandoffUseEnabled().then(setIsHandOffUseEnabled); }, []); const checkPossibilityOfCPFP = async () => { @@ -282,9 +279,12 @@ const TransactionsStatus = () => { } return ( - {isHandOffUseEnabled && ( - - )} + + diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index ac7b73c2b..c56c533d4 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -21,7 +21,6 @@ import { import { launchImageLibrary } from 'react-native-image-picker'; import Clipboard from '@react-native-community/clipboard'; import { Icon } from 'react-native-elements'; -import Handoff from 'react-native-handoff'; import { useRoute, useNavigation, useTheme, useFocusEffect } from '@react-navigation/native'; import isCatalyst from 'react-native-is-catalyst'; @@ -30,7 +29,7 @@ import { BlueTransactionListItem, BlueWalletNavigationHeader, BlueAlertWalletExp import WalletGradient from '../../class/wallet-gradient'; import navigationStyle from '../../components/navigationStyle'; import { LightningCustodianWallet, MultisigHDWallet, WatchOnlyWallet } from '../../class'; -import HandoffSettings from '../../class/handoff'; +import HandoffComponent from '../../blue_modules/handoff'; import ActionSheet from '../ActionSheet'; import loc from '../../loc'; import { FContainer, FButton } from '../../components/FloatButtons'; @@ -50,7 +49,6 @@ const buttonFontSize = const WalletTransactions = () => { const { wallets, saveToDisk, setSelectedWallet } = useContext(BlueStorageContext); - const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false); const [isLoading, setIsLoading] = useState(false); const [isManageFundsModalVisible, setIsManageFundsModalVisible] = useState(false); const { walletID } = useRoute().params; @@ -107,7 +105,6 @@ const WalletTransactions = () => { }; useEffect(() => { - HandoffSettings.isHandoffUseEnabled().then(setIsHandOffUseEnabled); const interval = setInterval(() => setTimeElapsed(prev => prev + 1), 60000); return () => { clearInterval(interval); @@ -590,8 +587,8 @@ const WalletTransactions = () => { return ( - {wallet.current.chain === Chain.ONCHAIN && wallet.current.type !== MultisigHDWallet.type && isHandOffUseEnabled && ( - Date: Mon, 18 Jan 2021 22:44:55 -0500 Subject: [PATCH 2/6] REF: Privacy module --- Privacy.js | 12 ------------ blue_modules/Privacy.android.js | 10 ++++++++++ blue_modules/Privacy.ios.js | 10 ++++++++++ blue_modules/Privacy.js | 5 +++++ screen/receive/details.js | 2 +- screen/send/create.js | 2 +- screen/wallets/export.js | 2 +- screen/wallets/exportMultisigCoordinationSetup.js | 2 +- screen/wallets/import.js | 2 +- screen/wallets/pleaseBackup.js | 2 +- screen/wallets/pleaseBackupLNDHub.js | 2 +- screen/wallets/viewEditMultisigCosigners.js | 2 +- screen/wallets/xpub.js | 2 +- 13 files changed, 34 insertions(+), 21 deletions(-) delete mode 100644 Privacy.js create mode 100644 blue_modules/Privacy.android.js create mode 100644 blue_modules/Privacy.ios.js create mode 100644 blue_modules/Privacy.js diff --git a/Privacy.js b/Privacy.js deleted file mode 100644 index 088f46dcf..000000000 --- a/Privacy.js +++ /dev/null @@ -1,12 +0,0 @@ -import Obscure from 'react-native-obscure'; -import { Platform } from 'react-native'; -import { enabled } from 'react-native-privacy-snapshot'; -export default class Privacy { - static enableBlur() { - Platform.OS === 'android' ? Obscure.activateObscure() : enabled(true); - } - - static disableBlur() { - Platform.OS === 'android' ? Obscure.deactivateObscure() : enabled(false); - } -} diff --git a/blue_modules/Privacy.android.js b/blue_modules/Privacy.android.js new file mode 100644 index 000000000..1d8586252 --- /dev/null +++ b/blue_modules/Privacy.android.js @@ -0,0 +1,10 @@ +import Obscure from 'react-native-obscure'; +export default class Privacy { + static enableBlur() { + Obscure.activateObscure(); + } + + static disableBlur() { + Obscure.deactivateObscure(); + } +} diff --git a/blue_modules/Privacy.ios.js b/blue_modules/Privacy.ios.js new file mode 100644 index 000000000..84dacf8a9 --- /dev/null +++ b/blue_modules/Privacy.ios.js @@ -0,0 +1,10 @@ +import { enabled } from 'react-native-privacy-snapshot'; +export default class Privacy { + static enableBlur() { + enabled(true); + } + + static disableBlur() { + enabled(false); + } +} diff --git a/blue_modules/Privacy.js b/blue_modules/Privacy.js new file mode 100644 index 000000000..8ca779e51 --- /dev/null +++ b/blue_modules/Privacy.js @@ -0,0 +1,5 @@ +export default class Privacy { + static enableBlur() {} + + static disableBlur() {} +} diff --git a/screen/receive/details.js b/screen/receive/details.js index 4f6e9231a..66a493356 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -29,7 +29,7 @@ import { } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; import BottomModal from '../../components/BottomModal'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import { Chain, BitcoinUnit } from '../../models/bitcoinUnits'; import HandoffSettings from '../../class/handoff'; import DeeplinkSchemaMatch from '../../class/deeplink-schema-match'; diff --git a/screen/send/create.js b/screen/send/create.js index b1cf3dfb9..50c7962ba 100644 --- a/screen/send/create.js +++ b/screen/send/create.js @@ -24,7 +24,7 @@ import isCatalyst from 'react-native-is-catalyst'; import { SafeBlueArea, BlueCard, BlueText } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import { BitcoinUnit } from '../../models/bitcoinUnits'; import loc from '../../loc'; import { BlueCurrentTheme } from '../../components/themes'; diff --git a/screen/wallets/export.js b/screen/wallets/export.js index f5b17f3af..20df00a6b 100644 --- a/screen/wallets/export.js +++ b/screen/wallets/export.js @@ -5,7 +5,7 @@ import { useTheme, useNavigation, useFocusEffect, useRoute } from '@react-naviga import { BlueSpacing20, SafeBlueArea, BlueText, BlueCopyTextToClipboard, BlueCard } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import Biometric from '../../class/biometrics'; import { LegacyWallet, LightningCustodianWallet, SegwitBech32Wallet, SegwitP2SHWallet, WatchOnlyWallet } from '../../class'; import loc from '../../loc'; diff --git a/screen/wallets/exportMultisigCoordinationSetup.js b/screen/wallets/exportMultisigCoordinationSetup.js index 2e72e3431..30a380e97 100644 --- a/screen/wallets/exportMultisigCoordinationSetup.js +++ b/screen/wallets/exportMultisigCoordinationSetup.js @@ -5,7 +5,7 @@ import { useFocusEffect, useNavigation, useRoute, useTheme } from '@react-naviga import { BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; import { DynamicQRCode } from '../../components/DynamicQRCode'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import Biometric from '../../class/biometrics'; import loc from '../../loc'; import { SquareButton } from '../../components/SquareButton'; diff --git a/screen/wallets/import.js b/screen/wallets/import.js index 53b72525f..fba274340 100644 --- a/screen/wallets/import.js +++ b/screen/wallets/import.js @@ -15,7 +15,7 @@ import { BlueSpacing20, } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import WalletImport from '../../class/wallet-import'; import loc from '../../loc'; const isDesktop = getSystemName() === 'Mac OS X'; diff --git a/screen/wallets/pleaseBackup.js b/screen/wallets/pleaseBackup.js index f69e15abc..9a7497a2e 100644 --- a/screen/wallets/pleaseBackup.js +++ b/screen/wallets/pleaseBackup.js @@ -4,7 +4,7 @@ import { useNavigation, useRoute, useTheme } from '@react-navigation/native'; import { BlueSpacing20, SafeBlueArea, BlueText, BlueButton } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; diff --git a/screen/wallets/pleaseBackupLNDHub.js b/screen/wallets/pleaseBackupLNDHub.js index 3516833e1..7243ee5c0 100644 --- a/screen/wallets/pleaseBackupLNDHub.js +++ b/screen/wallets/pleaseBackupLNDHub.js @@ -6,7 +6,7 @@ import { ScrollView } from 'react-native-gesture-handler'; import { BlueButton, BlueCopyTextToClipboard, BlueSpacing20, BlueText, BlueTextCentered, SafeBlueArea } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; import { LightningCustodianWallet } from '../../class'; diff --git a/screen/wallets/viewEditMultisigCosigners.js b/screen/wallets/viewEditMultisigCosigners.js index 141fcee95..dbf80685f 100644 --- a/screen/wallets/viewEditMultisigCosigners.js +++ b/screen/wallets/viewEditMultisigCosigners.js @@ -38,7 +38,7 @@ import MultipleStepsListItem, { MultipleStepsListItemButtohType, MultipleStepsListItemDashType, } from '../../components/MultipleStepsListItem'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import Biometric from '../../class/biometrics'; import QRCode from 'react-native-qrcode-svg'; import { SquareButton } from '../../components/SquareButton'; diff --git a/screen/wallets/xpub.js b/screen/wallets/xpub.js index 06de0cfd8..f9d14316c 100644 --- a/screen/wallets/xpub.js +++ b/screen/wallets/xpub.js @@ -5,7 +5,7 @@ import { useFocusEffect, useRoute, useNavigation, useTheme } from '@react-naviga import navigationStyle from '../../components/navigationStyle'; import { BlueSpacing20, SafeBlueArea, BlueText, BlueCopyTextToClipboard } from '../../BlueComponents'; -import Privacy from '../../Privacy'; +import Privacy from '../../blue_modules/Privacy'; import Biometric from '../../class/biometrics'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; From cbe3fb592f232e2888b295651a30c38eb47480a0 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 19 Jan 2021 07:11:31 -0500 Subject: [PATCH 3/6] Update handoff.ios.js --- blue_modules/handoff.ios.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blue_modules/handoff.ios.js b/blue_modules/handoff.ios.js index 8800e6090..37b516c87 100644 --- a/blue_modules/handoff.ios.js +++ b/blue_modules/handoff.ios.js @@ -8,7 +8,6 @@ const HandoffComponent = props => { return isHandOffUseEnabled && props && props.url ? : null; }; -HandoffComponent.STORAGE_KEY = 'HandOff'; export default HandoffComponent; HandoffComponent.propTypes = { From 1c4d4c100c21393a5267dbecd4c78386a42b3ea9 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Fri, 22 Jan 2021 11:34:47 -0500 Subject: [PATCH 4/6] REF: Update component location --- {blue_modules => components}/handoff.ios.js | 2 +- {blue_modules => components}/handoff.js | 0 screen/receive/details.js | 2 +- screen/transactions/details.js | 2 +- screen/transactions/transactionStatus.js | 2 +- screen/wallets/transactions.js | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename {blue_modules => components}/handoff.ios.js (85%) rename {blue_modules => components}/handoff.js (100%) diff --git a/blue_modules/handoff.ios.js b/components/handoff.ios.js similarity index 85% rename from blue_modules/handoff.ios.js rename to components/handoff.ios.js index 37b516c87..e18099aa7 100644 --- a/blue_modules/handoff.ios.js +++ b/components/handoff.ios.js @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import Handoff from 'react-native-handoff'; -import { BlueStorageContext } from './storage-context'; +import { BlueStorageContext } from '../blue_modules/storage-context'; import PropTypes from 'prop-types'; const HandoffComponent = props => { diff --git a/blue_modules/handoff.js b/components/handoff.js similarity index 100% rename from blue_modules/handoff.js rename to components/handoff.js diff --git a/screen/receive/details.js b/screen/receive/details.js index b51baf739..2439b3c6a 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -30,7 +30,7 @@ import navigationStyle from '../../components/navigationStyle'; import BottomModal from '../../components/BottomModal'; import Privacy from '../../Privacy'; import { Chain, BitcoinUnit } from '../../models/bitcoinUnits'; -import HandoffComponent from '../../blue_modules/handoff'; +import HandoffComponent from '../../components/handoff'; import DeeplinkSchemaMatch from '../../class/deeplink-schema-match'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; diff --git a/screen/transactions/details.js b/screen/transactions/details.js index 85febb9e7..23bb78dd4 100644 --- a/screen/transactions/details.js +++ b/screen/transactions/details.js @@ -4,7 +4,7 @@ import { View, ScrollView, TouchableOpacity, Text, TextInput, Linking, StatusBar import { useNavigation, useRoute, useTheme } from '@react-navigation/native'; import { BlueCard, BlueCopyToClipboardButton, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; -import HandoffComponent from '../../blue_modules/handoff'; +import HandoffComponent from '../../components/handoff'; import loc from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; const dayjs = require('dayjs'); diff --git a/screen/transactions/transactionStatus.js b/screen/transactions/transactionStatus.js index 5b5a74352..4d9eec3f5 100644 --- a/screen/transactions/transactionStatus.js +++ b/screen/transactions/transactionStatus.js @@ -18,7 +18,7 @@ import { import navigationStyle from '../../components/navigationStyle'; import { HDSegwitBech32Transaction } from '../../class'; import { BitcoinUnit } from '../../models/bitcoinUnits'; -import HandoffComponent from '../../blue_modules/handoff'; +import HandoffComponent from '../../components/handoff'; import loc, { formatBalanceWithoutSuffix } from '../../loc'; import { BlueStorageContext } from '../../blue_modules/storage-context'; diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index c56c533d4..f08bd503f 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -29,7 +29,7 @@ import { BlueTransactionListItem, BlueWalletNavigationHeader, BlueAlertWalletExp import WalletGradient from '../../class/wallet-gradient'; import navigationStyle from '../../components/navigationStyle'; import { LightningCustodianWallet, MultisigHDWallet, WatchOnlyWallet } from '../../class'; -import HandoffComponent from '../../blue_modules/handoff'; +import HandoffComponent from '../../components/handoff'; import ActionSheet from '../ActionSheet'; import loc from '../../loc'; import { FContainer, FButton } from '../../components/FloatButtons'; From d8347b0188753aa96d2111d77219b5d7cb67b4f9 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Sat, 23 Jan 2021 09:38:40 -0500 Subject: [PATCH 5/6] OPS: Add detox-recorder --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 14ed97a87..f4b2a9dd3 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "babel-eslint": "^10.1.0", "babel-jest": "^26.1.0", "babel-preset-flow": "^6.23.0", + "detox-recorder": "^1.0.149", "eslint": "^7.5.0", "eslint-plugin-babel": "^5.3.1", "eslint-plugin-import": "^2.22.0", From 6fe45cd18ea9145727630fb0113fa7a276c92075 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Sun, 24 Jan 2021 05:49:53 +0000 Subject: [PATCH 6/6] Translate /loc/en.json in fr_FR review completed for the source file '/loc/en.json' on the 'fr_FR' language. --- loc/fr_fr.json | 1 + 1 file changed, 1 insertion(+) diff --git a/loc/fr_fr.json b/loc/fr_fr.json index 653222d29..6e8ebd66b 100644 --- a/loc/fr_fr.json +++ b/loc/fr_fr.json @@ -177,6 +177,7 @@ "details_adv_full_sure": "Etes-vous sûr de vouloir utiliser la totalité de votre solde pour cette transaction ?", "details_adv_import": "Importer une transaction", "details_amount_field_is_not_valid": "Champ montant invalide", + "details_amount_field_is_less_than_minimum_amount_sat": "Le montant spécifié est trop petit. Veuillez entrer un montant supérieur à 500 sats.", "details_create": "Créer la requête", "details_error_decode": "Erreur : impossible de décoder l'adresse Bitcoin", "details_fee_field_is_not_valid": "Champ frais invalide",