From 30609af527a95945ce4ccc313bf94ab2278e6f25 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Sat, 1 Apr 2023 20:16:00 -0400 Subject: [PATCH] REF: Transactions Header JS > TSX --- BlueComponents.js | 4 +- class/wallets/abstract-wallet.ts | 4 + components/AmountInput.js | 7 +- components/TooltipMenu.ios.js | 16 +- components/TransactionsNavigationHeader.js | 323 -------------------- components/TransactionsNavigationHeader.tsx | 315 +++++++++++++++++++ components/navigationStyle.tsx | 13 +- ios/BlueWallet.xcodeproj/project.pbxproj | 6 +- ios/Podfile.lock | 8 +- screen/send/ScanQRCode.js | 14 +- screen/wallets/ldkViewLogs.js | 7 +- screen/wallets/list.js | 16 +- screen/wallets/transactions.js | 7 +- 13 files changed, 395 insertions(+), 345 deletions(-) delete mode 100644 components/TransactionsNavigationHeader.js create mode 100644 components/TransactionsNavigationHeader.tsx diff --git a/BlueComponents.js b/BlueComponents.js index 5ae2cf6bb..999ad7ad5 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -559,10 +559,10 @@ export const BlueHeaderDefaultMain = props => { > {props.leftText} - diff --git a/class/wallets/abstract-wallet.ts b/class/wallets/abstract-wallet.ts index a33684d73..d77feb33a 100644 --- a/class/wallets/abstract-wallet.ts +++ b/class/wallets/abstract-wallet.ts @@ -143,6 +143,10 @@ export class AbstractWallet { return BitcoinUnit.BTC; } + async allowOnchainAddress(): Promise { + throw new Error('allowOnchainAddress: Not implemented'); + } + allowBIP47(): boolean { return false; } diff --git a/components/AmountInput.js b/components/AmountInput.js index 4f471e096..2c67edc52 100644 --- a/components/AmountInput.js +++ b/components/AmountInput.js @@ -238,7 +238,12 @@ class AmountInput extends Component { }); return ( - this.textInput.focus()}> + this.textInput.focus()} + > <> {!disabled && } diff --git a/components/TooltipMenu.ios.js b/components/TooltipMenu.ios.js index c2824491b..2d0aa0b2d 100644 --- a/components/TooltipMenu.ios.js +++ b/components/TooltipMenu.ios.js @@ -59,7 +59,13 @@ const ToolTipMenu = (props, ref) => { }} style={buttonStyle} > - {props.onPress ? {props.children} : props.children} + {props.onPress ? ( + + {props.children} + + ) : ( + props.children + )} ) : ( { } : {})} > - {props.onPress ? {props.children} : props.children} + {props.onPress ? ( + + {props.children} + + ) : ( + props.children + )} ); }; diff --git a/components/TransactionsNavigationHeader.js b/components/TransactionsNavigationHeader.js deleted file mode 100644 index eb2270a78..000000000 --- a/components/TransactionsNavigationHeader.js +++ /dev/null @@ -1,323 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { Image, Text, TouchableOpacity, View, InteractionManager, I18nManager, StyleSheet } from 'react-native'; -import Clipboard from '@react-native-clipboard/clipboard'; -import LinearGradient from 'react-native-linear-gradient'; -import { LightningCustodianWallet, LightningLdkWallet, MultisigHDWallet } from '../class'; -import { BitcoinUnit } from '../models/bitcoinUnits'; -import WalletGradient from '../class/wallet-gradient'; -import Biometric from '../class/biometrics'; -import loc, { formatBalance } from '../loc'; -import { BlueStorageContext } from '../blue_modules/storage-context'; -import ToolTipMenu from './TooltipMenu'; -import { BluePrivateBalance } from '../BlueComponents'; - -export default class TransactionsNavigationHeader extends Component { - static propTypes = { - wallet: PropTypes.shape().isRequired, - onWalletUnitChange: PropTypes.func, - navigation: PropTypes.shape({ - navigate: PropTypes.func, - goBack: PropTypes.func, - }), - onManageFundsPressed: PropTypes.func, - }; - - static actionKeys = { - CopyToClipboard: 'copyToClipboard', - WalletBalanceVisibility: 'walletBalanceVisibility', - Refill: 'refill', - RefillWithExternalWallet: 'qrcode', - }; - - static actionIcons = { - Eye: { - iconType: 'SYSTEM', - iconValue: 'eye', - }, - EyeSlash: { - iconType: 'SYSTEM', - iconValue: 'eye.slash', - }, - Clipboard: { - iconType: 'SYSTEM', - iconValue: 'doc.on.doc', - }, - Refill: { - iconType: 'SYSTEM', - iconValue: 'goforward.plus', - }, - RefillWithExternalWallet: { - iconType: 'SYSTEM', - iconValue: 'qrcode', - }, - }; - - static getDerivedStateFromProps(props) { - return { wallet: props.wallet, onWalletUnitChange: props.onWalletUnitChange }; - } - - static contextType = BlueStorageContext; - constructor(props) { - super(props); - this.state = { - wallet: props.wallet, - walletPreviousPreferredUnit: props.wallet.getPreferredBalanceUnit(), - allowOnchainAddress: false, - }; - } - - menuRef = React.createRef(); - - handleCopyPress = _item => { - Clipboard.setString(formatBalance(this.state.wallet.getBalance(), this.state.wallet.getPreferredBalanceUnit()).toString()); - }; - - componentDidUpdate(prevState) { - InteractionManager.runAfterInteractions(() => { - if (prevState.wallet.getID() !== this.state.wallet.getID() && this.state.wallet.type === LightningCustodianWallet.type) { - this.verifyIfWalletAllowsOnchainAddress(); - } - }); - } - - verifyIfWalletAllowsOnchainAddress = () => { - if (this.state.wallet.type === LightningCustodianWallet.type) { - this.state.wallet - .allowOnchainAddress() - .then(value => this.setState({ allowOnchainAddress: value })) - .catch(e => { - console.log('This Lndhub wallet does not have an onchain address API.'); - this.setState({ allowOnchainAddress: false }); - }); - } - }; - - componentDidMount() { - this.verifyIfWalletAllowsOnchainAddress(); - } - - handleBalanceVisibility = async _item => { - const wallet = this.state.wallet; - - const isBiometricsEnabled = await Biometric.isBiometricUseCapableAndEnabled(); - - if (isBiometricsEnabled && wallet.hideBalance) { - if (!(await Biometric.unlockWithBiometrics())) { - return this.props.navigation.goBack(); - } - } - - wallet.hideBalance = !wallet.hideBalance; - this.setState({ wallet }); - await this.context.saveToDisk(); - }; - - changeWalletBalanceUnit = () => { - this.menuRef.current?.dismissMenu(); - let walletPreviousPreferredUnit = this.state.wallet.getPreferredBalanceUnit(); - const wallet = this.state.wallet; - if (walletPreviousPreferredUnit === BitcoinUnit.BTC) { - wallet.preferredBalanceUnit = BitcoinUnit.SATS; - walletPreviousPreferredUnit = BitcoinUnit.BTC; - } else if (walletPreviousPreferredUnit === BitcoinUnit.SATS) { - wallet.preferredBalanceUnit = BitcoinUnit.LOCAL_CURRENCY; - walletPreviousPreferredUnit = BitcoinUnit.SATS; - } else if (walletPreviousPreferredUnit === BitcoinUnit.LOCAL_CURRENCY) { - wallet.preferredBalanceUnit = BitcoinUnit.BTC; - walletPreviousPreferredUnit = BitcoinUnit.BTC; - } else { - wallet.preferredBalanceUnit = BitcoinUnit.BTC; - walletPreviousPreferredUnit = BitcoinUnit.BTC; - } - - this.setState({ wallet, walletPreviousPreferredUnit }, () => { - this.props.onWalletUnitChange(wallet); - }); - }; - - manageFundsPressed = id => { - this.props.onManageFundsPressed(id); - }; - - onPressMenuItem = id => { - if (id === TransactionsNavigationHeader.actionKeys.WalletBalanceVisibility) { - this.handleBalanceVisibility(); - } else if (id === TransactionsNavigationHeader.actionKeys.CopyToClipboard) { - this.handleCopyPress(); - } - }; - - toolTipMenuActions = [ - { - id: TransactionsNavigationHeader.actionKeys.Refill, - text: loc.lnd.refill, - icon: TransactionsNavigationHeader.actionIcons.Refill, - }, - { - id: TransactionsNavigationHeader.actionKeys.RefillWithExternalWallet, - text: loc.lnd.refill_external, - icon: TransactionsNavigationHeader.actionIcons.RefillWithExternalWallet, - }, - ]; - - render() { - const balance = - !this.state.wallet.hideBalance && - formatBalance(this.state.wallet.getBalance(), this.state.wallet.getPreferredBalanceUnit(), true).toString(); - - return ( - - { - switch (this.state.wallet.type) { - case LightningLdkWallet.type: - case LightningCustodianWallet.type: - return I18nManager.isRTL ? require('../img/lnd-shape-rtl.png') : require('../img/lnd-shape.png'); - case MultisigHDWallet.type: - return I18nManager.isRTL ? require('../img/vault-shape-rtl.png') : require('../img/vault-shape.png'); - default: - return I18nManager.isRTL ? require('../img/btc-shape-rtl.png') : require('../img/btc-shape.png'); - } - })()} - style={styles.chainIcon} - /> - - {this.state.wallet.getLabel()} - - - - {this.state.wallet.hideBalance ? ( - - ) : ( - - {balance} - - )} - - - {this.state.wallet.type === LightningCustodianWallet.type && this.state.allowOnchainAddress && ( - - {loc.lnd.title} - - )} - {this.state.wallet.allowBIP47() && this.state.wallet.isBIP47Enabled() && ( - { - this.props.navigation.navigate('PaymentCodeRoot', { - screen: 'PaymentCode', - params: { paymentCode: this.state.wallet.getBIP47PaymentCode() }, - }); - }} - > - - {loc.bip47.payment_code} - - - )} - {this.state.wallet.type === LightningLdkWallet.type && ( - - - {loc.lnd.title} - - - )} - {this.state.wallet.type === MultisigHDWallet.type && ( - - - {loc.multisig.manage_keys} - - - )} - - ); - } -} - -const styles = StyleSheet.create({ - lineaderGradient: { - padding: 15, - minHeight: 140, - justifyContent: 'center', - }, - chainIcon: { - width: 99, - height: 94, - position: 'absolute', - bottom: 0, - right: 0, - }, - walletLabel: { - backgroundColor: 'transparent', - fontSize: 19, - color: '#fff', - writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr', - }, - walletBalance: { - backgroundColor: 'transparent', - fontWeight: 'bold', - fontSize: 36, - color: '#fff', - writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr', - }, - manageFundsButton: { - marginTop: 14, - marginBottom: 10, - backgroundColor: 'rgba(255,255,255,0.2)', - borderRadius: 9, - minHeight: 39, - alignSelf: 'flex-start', - justifyContent: 'center', - alignItems: 'center', - }, - manageFundsButtonText: { - fontWeight: '500', - fontSize: 14, - color: '#FFFFFF', - padding: 12, - }, -}); diff --git a/components/TransactionsNavigationHeader.tsx b/components/TransactionsNavigationHeader.tsx new file mode 100644 index 000000000..42b15848b --- /dev/null +++ b/components/TransactionsNavigationHeader.tsx @@ -0,0 +1,315 @@ +import React, { useState, useEffect, useRef, useContext, useCallback, useMemo } from 'react'; +import { Image, Text, TouchableOpacity, View, I18nManager, StyleSheet } from 'react-native'; +import Clipboard from '@react-native-clipboard/clipboard'; +import LinearGradient from 'react-native-linear-gradient'; +import { AbstractWallet, LightningCustodianWallet, LightningLdkWallet, MultisigHDWallet } from '../class'; +import { BitcoinUnit } from '../models/bitcoinUnits'; +import WalletGradient from '../class/wallet-gradient'; +import Biometric from '../class/biometrics'; +import loc, { formatBalance } from '../loc'; +import { BlueStorageContext } from '../blue_modules/storage-context'; +import ToolTipMenu from './TooltipMenu'; +import { BluePrivateBalance } from '../BlueComponents'; + +interface TransactionsNavigationHeaderProps { + wallet: AbstractWallet; + onWalletUnitChange?: (wallet: any) => void; + navigation: { + navigate: (route: string, params?: any) => void; + goBack: () => void; + }; + onHandleManageFundsPressed?: (id: string) => void; // Add a type definition for this prop + actionKeys: { + CopyToClipboard: 'copyToClipboard'; + WalletBalanceVisibility: 'walletBalanceVisibility'; + Refill: 'refill'; + RefillWithExternalWallet: 'qrcode'; + }; +} + +const TransactionsNavigationHeader: React.FC = ({ + // @ts-ignore: Ugh + wallet: initialWallet, + // @ts-ignore: Ugh + onWalletUnitChange, + // @ts-ignore: Ugh + navigation, + // @ts-ignore: Ugh + onHandleManageFundsPressed, +}) => { + const [wallet, setWallet] = useState(initialWallet); + const [allowOnchainAddress, setAllowOnchainAddress] = useState(false); + + const context = useContext(BlueStorageContext); + const menuRef = useRef(null); + + const verifyIfWalletAllowsOnchainAddress = useCallback(() => { + if (wallet.type === LightningCustodianWallet.type) { + wallet + .allowOnchainAddress() + .then((value: boolean) => setAllowOnchainAddress(value)) + .catch((e: any) => { + console.log('This Lndhub wallet does not have an onchain address API.'); + setAllowOnchainAddress(false); + }); + } + }, [wallet]); + + useEffect(() => { + verifyIfWalletAllowsOnchainAddress(); + }, [wallet, verifyIfWalletAllowsOnchainAddress]); + + const handleCopyPress = () => { + Clipboard.setString(formatBalance(wallet.getBalance(), wallet.getPreferredBalanceUnit()).toString()); + }; + + const updateWalletVisibility = (wallet: AbstractWallet, newHideBalance: boolean) => { + const clonedWallet = Object.assign(Object.create(Object.getPrototypeOf(wallet)), wallet); + clonedWallet.hideBalance = newHideBalance; + return clonedWallet; + }; + + const handleBalanceVisibility = async () => { + // @ts-ignore: Gotta update this class + const isBiometricsEnabled = await Biometric.isBiometricUseCapableAndEnabled(); + + if (isBiometricsEnabled && wallet.hideBalance) { + // @ts-ignore: Ugh + if (!(await Biometric.unlockWithBiometrics())) { + return navigation.goBack(); + } + } + + const updatedWallet = updateWalletVisibility(wallet, !wallet.hideBalance); + setWallet(updatedWallet); + await context.saveToDisk(); + }; + + const updateWalletWithNewUnit = (wallet: AbstractWallet, newPreferredUnit: BitcoinUnit) => { + const clonedWallet = Object.assign(Object.create(Object.getPrototypeOf(wallet)), wallet); + clonedWallet.preferredBalanceUnit = newPreferredUnit; + return clonedWallet; + }; + + const changeWalletBalanceUnit = () => { + // @ts-ignore: Ugh + menuRef.current?.dismissMenu(); + let newWalletPreferredUnit = wallet.getPreferredBalanceUnit(); + + if (newWalletPreferredUnit === BitcoinUnit.BTC) { + newWalletPreferredUnit = BitcoinUnit.SATS; + } else if (newWalletPreferredUnit === BitcoinUnit.SATS) { + newWalletPreferredUnit = BitcoinUnit.LOCAL_CURRENCY; + } else if (newWalletPreferredUnit === BitcoinUnit.LOCAL_CURRENCY) { + newWalletPreferredUnit = BitcoinUnit.BTC; + } else { + newWalletPreferredUnit = BitcoinUnit.BTC; + } + + const updatedWallet = updateWalletWithNewUnit(wallet, newWalletPreferredUnit); + setWallet(updatedWallet); + onWalletUnitChange?.(updatedWallet); + }; + + const handleManageFundsPressed = () => { + onHandleManageFundsPressed?.(actionKeys.Refill); + }; + + const onPressMenuItem = (id: string) => { + if (id === 'walletBalanceVisibility') { + handleBalanceVisibility(); + } else if (id === 'copyToClipboard') { + handleCopyPress(); + } + }; + + const balance = useMemo(() => { + return !wallet.hideBalance && formatBalance(wallet.getBalance(), wallet.getPreferredBalanceUnit(), true).toString(); + }, [wallet]); + + return ( + + { + switch (wallet.type) { + case LightningLdkWallet.type: + case LightningCustodianWallet.type: + return I18nManager.isRTL ? require('../img/lnd-shape-rtl.png') : require('../img/lnd-shape.png'); + case MultisigHDWallet.type: + return I18nManager.isRTL ? require('../img/vault-shape-rtl.png') : require('../img/vault-shape.png'); + default: + return I18nManager.isRTL ? require('../img/btc-shape-rtl.png') : require('../img/btc-shape.png'); + } + })()} + style={styles.chainIcon} + /> + + {wallet.getLabel()} + + + + {wallet.hideBalance ? ( + + ) : ( + + {balance} + + )} + + + {wallet.type === LightningCustodianWallet.type && allowOnchainAddress && ( + + {loc.lnd.title} + + )} + + {wallet.type === MultisigHDWallet.type && ( + + + {loc.multisig.manage_keys} + + + )} + + ); +}; + +const styles = StyleSheet.create({ + lineaderGradient: { + padding: 15, + minHeight: 140, + justifyContent: 'center', + }, + chainIcon: { + width: 99, + height: 94, + position: 'absolute', + bottom: 0, + right: 0, + }, + walletLabel: { + backgroundColor: 'transparent', + fontSize: 19, + color: '#fff', + writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr', + }, + walletBalance: { + backgroundColor: 'transparent', + fontWeight: 'bold', + fontSize: 36, + color: '#fff', + writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr', + }, + manageFundsButton: { + marginTop: 14, + marginBottom: 10, + backgroundColor: 'rgba(255,255,255,0.2)', + borderRadius: 9, + minHeight: 39, + alignSelf: 'flex-start', + justifyContent: 'center', + alignItems: 'center', + }, + manageFundsButtonText: { + fontWeight: '500', + fontSize: 14, + color: '#FFFFFF', + padding: 12, + }, +}); + +export const actionKeys = { + CopyToClipboard: 'copyToClipboard', + WalletBalanceVisibility: 'walletBalanceVisibility', + Refill: 'refill', + RefillWithExternalWallet: 'qrcode', +}; + +export const actionIcons = { + Eye: { + iconType: 'SYSTEM', + iconValue: 'eye', + }, + EyeSlash: { + iconType: 'SYSTEM', + iconValue: 'eye.slash', + }, + Clipboard: { + iconType: 'SYSTEM', + iconValue: 'doc.on.doc', + }, + Refill: { + iconType: 'SYSTEM', + iconValue: 'goforward.plus', + }, + RefillWithExternalWallet: { + iconType: 'SYSTEM', + iconValue: 'qrcode', + }, +}; + +export default TransactionsNavigationHeader; diff --git a/components/navigationStyle.tsx b/components/navigationStyle.tsx index 56c79a727..1a0566fb8 100644 --- a/components/navigationStyle.tsx +++ b/components/navigationStyle.tsx @@ -42,6 +42,7 @@ const navigationStyle = ( ...opts }: NavigationOptions & { closeButton?: boolean; + closeButtonFunc?: (deps: { navigation: any; route: any }) => React.ReactElement; }, formatter: OptionsFormatter, @@ -57,7 +58,12 @@ const navigationStyle = ( navigation.goBack(null); }; headerRight = () => ( - @@ -108,7 +114,10 @@ export const navigationStyleTx = (opts: NavigationOptions, formatter: OptionsFor headerBackTitleVisible: false, headerTintColor: theme.colors.foregroundColor, headerLeft: () => ( - { Keyboard.dismiss(); navigation.goBack(null); diff --git a/ios/BlueWallet.xcodeproj/project.pbxproj b/ios/BlueWallet.xcodeproj/project.pbxproj index 2859ba622..35dde9bca 100644 --- a/ios/BlueWallet.xcodeproj/project.pbxproj +++ b/ios/BlueWallet.xcodeproj/project.pbxproj @@ -919,7 +919,7 @@ ); mainGroup = 83CBB9F61A601CBA00E9B192; packageReferences = ( - 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */, + 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */, ); productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; @@ -1981,7 +1981,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */ = { + 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/EFPrefix/EFQRCode.git"; requirement = { @@ -1994,7 +1994,7 @@ /* Begin XCSwiftPackageProductDependency section */ 6DFC806F24EA0B6C007B8700 /* EFQRCode */ = { isa = XCSwiftPackageProductDependency; - package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */; + package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */; productName = EFQRCode; }; /* End XCSwiftPackageProductDependency section */ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index f76733c2b..6c0025b55 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -396,7 +396,7 @@ PODS: - React - rn-ldk (0.8.4): - React-Core - - RNCAsyncStorage (1.18.0): + - RNCAsyncStorage (1.18.1): - React-Core - RNCClipboard (1.11.2): - React-Core @@ -456,7 +456,7 @@ PODS: - React-RCTImage - RNShare (8.2.1): - React-Core - - RNSVG (13.8.0): + - RNSVG (13.9.0): - React-Core - RNVectorIcons (9.2.0): - React-Core @@ -764,7 +764,7 @@ SPEC CHECKSUMS: ReactNativeCameraKit: 9d46a5d7dd544ca64aa9c03c150d2348faf437eb RealmJS: 10958b8a9d1f3a981c1b50bdc1da8396002e75a4 rn-ldk: 0d8749d98cc5ce67302a32831818c116b67f7643 - RNCAsyncStorage: a46ee6bf15cf1ba863d0a47287236f9c95d5b213 + RNCAsyncStorage: b90b71f45b8b97be43bc4284e71a6af48ac9f547 RNCClipboard: 3f0451a8100393908bea5c5c5b16f96d45f30bfc RNCPushNotificationIOS: 87b8d16d3ede4532745e05b03c42cff33a36cc45 RNDefaultPreference: 08bdb06cfa9188d5da97d4642dac745218d7fb31 @@ -781,7 +781,7 @@ SPEC CHECKSUMS: RNReanimated: cc5e3aa479cb9170bcccf8204291a6950a3be128 RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f RNShare: eaee3dd5a06dad397c7d3b14762007035c5de405 - RNSVG: c1e76b81c76cdcd34b4e1188852892dc280eb902 + RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315 RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8 RNWatch: fd30ca40a5b5ef58dcbc195638e68219bc455236 Yoga: cd7d7f509dbfac14ee7f31a6c750acb957cd5022 diff --git a/screen/send/ScanQRCode.js b/screen/send/ScanQRCode.js index 3452bd3c0..d9b0e55d4 100644 --- a/screen/send/ScanQRCode.js +++ b/screen/send/ScanQRCode.js @@ -347,11 +347,21 @@ const ScanQRCode = () => { - + {showFileImportButton && ( - + )} diff --git a/screen/wallets/ldkViewLogs.js b/screen/wallets/ldkViewLogs.js index ee2b06d89..17c65d568 100644 --- a/screen/wallets/ldkViewLogs.js +++ b/screen/wallets/ldkViewLogs.js @@ -39,7 +39,12 @@ const LdkViewLogs = () => { .finally(() => { setOptions({ headerRight: () => ( - + ), diff --git a/screen/wallets/list.js b/screen/wallets/list.js index a580d8bac..81bc7ffee 100644 --- a/screen/wallets/list.js +++ b/screen/wallets/list.js @@ -103,13 +103,25 @@ const WalletsList = () => { }, headerRight: () => I18nManager.isRTL ? null : ( - + ), headerLeft: () => I18nManager.isRTL ? ( - + ) : null, diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index d5f02ca16..9011bf089 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -30,7 +30,7 @@ import { BlueStorageContext } from '../../blue_modules/storage-context'; import { isDesktop } from '../../blue_modules/environment'; import BlueClipboard from '../../blue_modules/clipboard'; import LNNodeBar from '../../components/LNNodeBar'; -import TransactionsNavigationHeader from '../../components/TransactionsNavigationHeader'; +import TransactionsNavigationHeader, { actionKeys } from '../../components/TransactionsNavigationHeader'; import { TransactionListItem } from '../../components/TransactionListItem'; import alert from '../../components/Alert'; import PropTypes from 'prop-types'; @@ -450,14 +450,14 @@ const WalletTransactions = ({ navigation }) => { }; const onManageFundsPressed = ({ id }) => { - if (id === TransactionsNavigationHeader.actionKeys.Refill) { + if (id === actionKeys.Refill) { const availableWallets = [...wallets.filter(item => item.chain === Chain.ONCHAIN && item.allowSend())]; if (availableWallets.length === 0) { alert(loc.lnd.refill_create); } else { navigate('SelectWallet', { onWalletSelect, chainType: Chain.ONCHAIN }); } - } else if (id === TransactionsNavigationHeader.actionKeys.RefillWithExternalWallet) { + } else if (id === actionKeys.RefillWithExternalWallet) { if (wallet.getUserHasSavedExport()) { navigate('ReceiveDetailsRoot', { screen: 'ReceiveDetails', @@ -512,6 +512,7 @@ const WalletTransactions = ({ navigation }) => { { // pagination in works. in this block we will add more txs to FlatList // so as user scrolls closer to bottom it will render mode transactions