REF: Continue renaming

This commit is contained in:
Marcos Rodriguez Velez 2024-05-31 13:22:22 -04:00
parent f5977fcb5a
commit ed68a20b4f
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
11 changed files with 33 additions and 39 deletions

View File

@ -1,12 +1,10 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { useNavigation, useRoute } from '@react-navigation/native';
import { useRoute } from '@react-navigation/native';
import React, { useEffect, useState } from 'react';
import { I18nManager, Image, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import { btcToSatoshi, fiatToBTC, satoshiToBTC, satoshiToLocalCurrency } from '../../blue_modules/currency';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueDismissKeyboardInputAccessory, BlueLoading, BlueSpacing20, BlueText } from '../../BlueComponents';
import Lnurl from '../../class/lnurl';
import presentAlert from '../../components/Alert';
@ -18,6 +16,8 @@ import prompt from '../../helpers/prompt';
import { useBiometrics } from '../../hooks/useBiometrics';
import loc, { formatBalance, formatBalanceWithoutSuffix } from '../../loc';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
/**
* if user has default currency - fiat, attempting to pay will trigger conversion from entered in input field fiat value
@ -37,7 +37,7 @@ const LnurlPay = () => {
const [_LN, setLN] = useState();
const [payButtonDisabled, setPayButtonDisabled] = useState(true);
const [payload, setPayload] = useState();
const { setParams, pop, navigate } = useNavigation();
const { setParams, pop, navigate } = useExtendedNavigation();
const [amount, setAmount] = useState();
const { colors } = useTheme();
const stylesHook = StyleSheet.create({

View File

@ -15,7 +15,6 @@ import { Icon } from 'react-native-elements';
import { btcToSatoshi, fiatToBTC } from '../../blue_modules/currency';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueDismissKeyboardInputAccessory, BlueLoading } from '../../BlueComponents';
import Lnurl from '../../class/lnurl';
import AddressInput from '../../components/AddressInput';
@ -27,6 +26,7 @@ import { useTheme } from '../../components/themes';
import { useBiometrics } from '../../hooks/useBiometrics';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
const ScanLndInvoice = () => {
const { wallets, fetchAndSaveWalletTransactions } = useStorage();

View File

@ -2,13 +2,12 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { I18nManager, Keyboard, StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native';
import { Icon } from 'react-native-elements';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueLoading, BlueSpacing, BlueText } from '../../BlueComponents';
import Azteco from '../../class/azteco';
import presentAlert from '../../components/Alert';
import Button from '../../components/Button';
import loc from '../../loc';
import { StorageContext } from '../../components/Context/StorageProvider';
const styles = StyleSheet.create({
loading: {
@ -51,7 +50,7 @@ const styles = StyleSheet.create({
});
export default class AztecoRedeem extends Component {
static contextType = BlueStorageContext;
static contextType = StorageContext;
state = { isLoading: true };
constructor(props, context) {

View File

@ -1,8 +1,6 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useContext, useRef, useState } from 'react';
import React, { useRef, useState } from 'react';
import { useRoute } from '@react-navigation/native';
import { Keyboard, KeyboardAvoidingView, Platform, StyleSheet, TextInput, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueButtonLink, BlueCard, BlueSpacing10, BlueSpacing20, BlueText } from '../../BlueComponents';
import Button from '../../components/Button';
import navigationStyle from '../../components/navigationStyle';
@ -10,11 +8,13 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import { requestCameraAuthorization } from '../../helpers/scan-qr';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
const IsItMyAddress = () => {
/** @type {AbstractWallet[]} */
const wallets = useContext(BlueStorageContext).wallets;
const { navigate } = useNavigation();
const { wallets } = useStorage();
const { navigate } = useExtendedNavigation();
const { name } = useRoute();
const { colors } = useTheme();
const scanButtonRef = useRef();

View File

@ -1,15 +1,13 @@
import Clipboard from '@react-native-clipboard/clipboard';
import { useIsFocused, useNavigation, useRoute } from '@react-navigation/native';
import { useIsFocused, useRoute } from '@react-navigation/native';
import * as bitcoin from 'bitcoinjs-lib';
import React, { useEffect, useRef, useState } from 'react';
import { ActivityIndicator, Linking, Platform, ScrollView, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
import DocumentPicker from 'react-native-document-picker';
import RNFS from 'react-native-fs';
import * as BlueElectrum from '../../blue_modules/BlueElectrum';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import Notifications from '../../blue_modules/notifications';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueSpacing20, BlueText } from '../../BlueComponents';
import presentAlert from '../../components/Alert';
import CopyToClipboardButton from '../../components/CopyToClipboardButton';
@ -20,12 +18,13 @@ import { useTheme } from '../../components/themes';
import { requestCameraAuthorization } from '../../helpers/scan-qr';
import { useBiometrics } from '../../hooks/useBiometrics';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
const PsbtWithHardwareWallet = () => {
const { txMetadata, fetchAndSaveWalletTransactions, isElectrumDisabled } = useStorage();
const { isBiometricUseCapableAndEnabled, unlockWithBiometrics } = useBiometrics();
const navigation = useNavigation();
const navigation = useExtendedNavigation();
const route = useRoute();
const { fromWallet, memo, psbt, deepLinkPSBT, launchedBy } = route.params;
const routeParamsPSBT = useRef(route.params.psbt);

View File

@ -16,10 +16,8 @@ import {
View,
} from 'react-native';
import DefaultPreference from 'react-native-default-preference';
import * as BlueElectrum from '../../blue_modules/BlueElectrum';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import {
BlueButtonLink,
BlueCard,
@ -36,9 +34,10 @@ import ListItem from '../../components/ListItem';
import { BlueCurrentTheme } from '../../components/themes';
import { scanQrHelper } from '../../helpers/scan-qr';
import loc from '../../loc';
import { StorageContext } from '../../components/Context/StorageProvider';
export default class ElectrumSettings extends Component {
static contextType = BlueStorageContext;
static contextType = StorageContext;
constructor(props) {
super(props);
const server = props?.route?.params?.server;

View File

@ -1,5 +1,3 @@
import Clipboard from '@react-native-clipboard/clipboard';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import {
ActivityIndicator,
@ -12,12 +10,12 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
import PropTypes from 'prop-types';
import { Text } from 'react-native-elements';
import * as BlueElectrum from '../../blue_modules/BlueElectrum';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import Notifications from '../../blue_modules/notifications';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueCard, BlueReplaceFeeSuggestions, BlueSpacing, BlueSpacing20, BlueText } from '../../BlueComponents';
import { HDSegwitBech32Transaction, HDSegwitBech32Wallet } from '../../class';
import presentAlert from '../../components/Alert';
@ -26,6 +24,7 @@ import navigationStyle from '../../components/navigationStyle';
import SafeArea from '../../components/SafeArea';
import { BlueCurrentTheme } from '../../components/themes';
import loc from '../../loc';
import { StorageContext } from '../../components/Context/StorageProvider';
const styles = StyleSheet.create({
root: {
@ -67,7 +66,7 @@ const styles = StyleSheet.create({
});
export default class CPFP extends Component {
static contextType = BlueStorageContext;
static contextType = StorageContext;
constructor(props) {
super(props);
let txid;

View File

@ -1,8 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import { ActivityIndicator, ScrollView, StyleSheet, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueSpacing20, BlueText } from '../../BlueComponents';
import { HDSegwitBech32Transaction, HDSegwitBech32Wallet } from '../../class';
import presentAlert from '../../components/Alert';
@ -10,6 +8,7 @@ import navigationStyle from '../../components/navigationStyle';
import SafeArea from '../../components/SafeArea';
import loc from '../../loc';
import CPFP from './CPFP';
import { StorageContext } from '../../components/Context/StorageProvider';
const styles = StyleSheet.create({
root: {
@ -19,7 +18,7 @@ const styles = StyleSheet.create({
});
export default class RBFBumpFee extends CPFP {
static contextType = BlueStorageContext;
static contextType = StorageContext;
async componentDidMount() {
console.log('transactions/RBFBumpFee - componentDidMount');

View File

@ -1,8 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import { ActivityIndicator, ScrollView, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueSpacing20, BlueText } from '../../BlueComponents';
import { HDSegwitBech32Transaction, HDSegwitBech32Wallet } from '../../class';
import presentAlert from '../../components/Alert';
@ -10,9 +8,10 @@ import navigationStyle from '../../components/navigationStyle';
import SafeArea from '../../components/SafeArea';
import loc from '../../loc';
import CPFP from './CPFP';
import { StorageContext } from '../../components/Context/StorageProvider';
export default class RBFCancel extends CPFP {
static contextType = BlueStorageContext;
static contextType = StorageContext;
async componentDidMount() {
console.log('transactions/RBFCancel - componentDidMount');
this.setState({

View File

@ -1,5 +1,5 @@
import { useRoute } from '@react-navigation/native';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useRoute } from '@react-navigation/native';
import {
ActivityIndicator,
Alert,
@ -17,11 +17,9 @@ import {
TouchableWithoutFeedback,
View,
} from 'react-native';
import { writeFileAndExport } from '../../blue_modules/fs';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import Notifications from '../../blue_modules/notifications';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueLoading, BlueSpacing10, BlueSpacing20, BlueText } from '../../BlueComponents';
import {
HDAezeedWallet,
@ -48,6 +46,7 @@ import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { useSettings } from '../../hooks/context/useSettings';
import { useStorage } from '../../hooks/context/useStorage';
const styles = StyleSheet.create({
scrollViewContent: {

View File

@ -24,7 +24,6 @@ import BlueClipboard from '../../blue_modules/clipboard';
import { isDesktop } from '../../blue_modules/environment';
import * as fs from '../../blue_modules/fs';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { useStorage, WalletTransactionsStatus } from '../../blue_modules/storage-context';
import { LightningCustodianWallet, LightningLdkWallet, MultisigHDWallet, WatchOnlyWallet } from '../../class';
import WalletGradient from '../../class/wallet-gradient';
import presentAlert from '../../components/Alert';
@ -41,6 +40,8 @@ import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc from '../../loc';
import { Chain } from '../../models/bitcoinUnits';
import ActionSheet from '../ActionSheet';
import { useStorage } from '../../hooks/context/useStorage';
import { WalletTransactionsStatus } from '../../components/Context/StorageProvider';
const buttonFontSize =
PixelRatio.roundToNearestPixel(Dimensions.get('window').width / 26) > 22