REF: Import directory

This commit is contained in:
Marcos Rodriguez Velez 2024-05-31 13:18:01 -04:00
parent de8e8d2d3c
commit f5977fcb5a
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
66 changed files with 130 additions and 167 deletions

View File

@ -5,11 +5,11 @@ import React from 'react';
import { useColorScheme } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { LargeScreenProvider } from './components/Context/LargeScreenProvider';
import { SettingsProvider } from './components/Context/SettingsContext';
import { SettingsProvider } from './components/Context/SettingsProvider';
import { BlueDarkTheme, BlueDefaultTheme } from './components/themes';
import MasterView from './navigation/MasterView';
import { navigationRef } from './NavigationService';
import { BlueStorageProvider } from './components/Context/BlueStorageContext';
import { StorageProvider } from './components/Context/StorageProvider';
const App = () => {
const colorScheme = useColorScheme();
@ -18,11 +18,11 @@ const App = () => {
<LargeScreenProvider>
<NavigationContainer ref={navigationRef} theme={colorScheme === 'dark' ? BlueDarkTheme : BlueDefaultTheme}>
<SafeAreaProvider>
<BlueStorageProvider>
<StorageProvider>
<SettingsProvider>
<MasterView />
</SettingsProvider>
</BlueStorageProvider>
</StorageProvider>
</SafeAreaProvider>
</NavigationContainer>
</LargeScreenProvider>

View File

@ -1,9 +1,8 @@
import 'react-native-gesture-handler'; // should be on top
import React, { lazy, Suspense } from 'react';
import { useStorage } from './blue_modules/storage-context';
import MainRoot from './navigation';
import { useStorage } from './hooks/context/useStorage';
const CompanionDelegates = lazy(() => import('./components/CompanionDelegates'));
const MasterView = () => {

View File

@ -1,16 +1,15 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { CommonActions } from '@react-navigation/native';
import { useContext, useEffect } from 'react';
import { useEffect } from 'react';
import { DeviceEventEmitter, Linking, Platform } from 'react-native';
import QuickActions from 'react-native-quick-actions';
import { BlueStorageContext } from '../blue_modules/storage-context';
import DeeplinkSchemaMatch from '../class/deeplink-schema-match';
import { TWallet } from '../class/wallets/types';
import { useSettings } from '../components/Context/SettingsContext';
import useOnAppLaunch from '../hooks/useOnAppLaunch';
import { formatBalance } from '../loc';
import * as NavigationService from '../NavigationService';
import { useSettings } from '../hooks/context/useSettings';
import { useStorage } from '../hooks/context/useStorage';
const DeviceQuickActionsStorageKey = 'DeviceQuickActionsEnabled';

View File

@ -2,10 +2,9 @@ import React from 'react';
import DefaultPreference from 'react-native-default-preference';
// @ts-ignore: react-native-handoff is not in the type definition
import Handoff from 'react-native-handoff';
import { GROUP_IO_BLUEWALLET } from '../blue_modules/currency';
import { BlueApp } from '../class';
import { useSettings } from './Context/SettingsContext';
import { useSettings } from '../hooks/context/useSettings';
interface HandOffComponentProps {
url?: string;

View File

@ -1,9 +1,8 @@
import React, { useEffect } from 'react';
import { NativeEventEmitter, NativeModules } from 'react-native';
import { useStorage } from '../blue_modules/storage-context';
import * as NavigationService from '../NavigationService';
import HandOffComponent from './HandOffComponent.ios';
import { useStorage } from '../hooks/context/useStorage';
interface UserActivityData {
activityType: keyof typeof HandOffComponent.activityTypes;

View File

@ -1,8 +1,8 @@
import { CommonActions } from '@react-navigation/native';
import { useCallback, useContext, useEffect } from 'react';
import { useCallback, useEffect } from 'react';
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
import { BlueStorageContext } from '../blue_modules/storage-context';
import * as NavigationService from '../NavigationService';
import { useStorage } from '../hooks/context/useStorage';
/*
Component for iPadOS and macOS menu items with keyboard shortcuts.

View File

@ -13,7 +13,7 @@ import TransactionOutgoingIcon from '../components/icons/TransactionOutgoingIcon
import TransactionPendingIcon from '../components/icons/TransactionPendingIcon';
import loc, { formatBalanceWithoutSuffix, transactionTimeToReadable } from '../loc';
import { BitcoinUnit } from '../models/bitcoinUnits';
import { useSettings } from './Context/SettingsContext';
import { useSettings } from '../hooks/context/useSettings';
import ListItem from './ListItem';
import { useTheme } from './themes';
import ToolTipMenu from './TooltipMenu';

View File

@ -10,7 +10,7 @@ import loc, { formatBalance, formatBalanceWithoutSuffix } from '../loc';
import { BitcoinUnit } from '../models/bitcoinUnits';
import { FiatUnit } from '../models/fiatUnit';
import { BlurredBalanceView } from './BlurredBalanceView';
import { useSettings } from './Context/SettingsContext';
import { useSettings } from '../hooks/context/useSettings';
import ToolTipMenu from './TooltipMenu';
import { ToolTipMenuProps } from './types';

View File

@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import React, { forwardRef, useCallback, useContext, useImperativeHandle, useRef } from 'react';
import React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
import {
Animated,
FlatList,
@ -14,16 +14,16 @@ import {
View,
} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import { BlueStorageContext, WalletTransactionsStatus } from '../blue_modules/storage-context';
import { BlueSpacing10 } from '../BlueComponents';
import { LightningCustodianWallet, LightningLdkWallet, MultisigHDWallet } from '../class';
import WalletGradient from '../class/wallet-gradient';
import { useIsLargeScreen } from '../hooks/useIsLargeScreen';
import loc, { formatBalance, transactionTimeToReadable } from '../loc';
import { BlurredBalanceView } from './BlurredBalanceView';
import { useSettings } from './Context/SettingsContext';
import { useSettings } from '../../hooks/context/useSettings';
import { useTheme } from './themes';
import { useStorage } from '../hooks/context/useStorage';
import { WalletTransactionsStatus } from './Context/StorageProvider';
const nStyles = StyleSheet.create({
container: {

View File

@ -1,4 +1,4 @@
import React, { useContext, useEffect, useRef } from 'react';
import React, { useEffect, useRef } from 'react';
import {
transferCurrentComplicationUserInfo,
transferUserInfo,
@ -7,14 +7,13 @@ import {
useReachability,
watchEvents,
} from 'react-native-watch-connectivity';
import Notifications from '../blue_modules/notifications';
import { BlueStorageContext } from '../blue_modules/storage-context';
import { MultisigHDWallet } from '../class';
import loc, { formatBalance, transactionTimeToReadable } from '../loc';
import { Chain } from '../models/bitcoinUnits';
import { FiatUnit } from '../models/fiatUnit';
import { useSettings } from './Context/SettingsContext';
import { useSettings } from '../hooks/context/useSettings';
import { useStorage } from '../hooks/context/useStorage';
function WatchConnectivity() {
const { walletsInitialized, wallets, fetchWalletTransactions, saveToDisk, txMetadata } = useStorage();

View File

@ -1,9 +1,8 @@
import React, { useContext, useEffect } from 'react';
import React, { useEffect } from 'react';
import DefaultPreference from 'react-native-default-preference';
import { BlueStorageContext } from '../blue_modules/storage-context';
import { TWallet } from '../class/wallets/types';
import { useSettings } from './Context/SettingsContext';
import { useSettings } from '../hooks/context/useSettings';
import { useStorage } from '../hooks/context/useStorage';
enum WidgetCommunicationKeys {
AllWalletsSatoshiBalance = 'WidgetCommunicationAllWalletsSatoshiBalance',

View File

@ -1,4 +1,4 @@
import { useContext } from 'react';
import { SettingsContext } from '../../components/Context/SettingsPriver';
import { SettingsContext } from '../../components/Context/SettingsProvider';
export const useSettings = () => useContext(SettingsContext);

View File

@ -5,8 +5,8 @@ import PasscodeAuth from 'react-native-passcode-auth';
import RNSecureKeyStore, { ACCESSIBLE } from 'react-native-secure-key-store';
import loc from '../loc';
import * as NavigationService from '../NavigationService';
import { useStorage } from '../blue_modules/storage-context';
import presentAlert from '../components/Alert';
import { useStorage } from './context/useStorage';
const STORAGEKEY = 'Biometrics';
const rnBiometrics = new ReactNativeBiometrics({ allowDeviceCredentials: true });

View File

@ -1,8 +1,8 @@
import { useNavigation, NavigationProp, ParamListBase } from '@react-navigation/native';
import { navigationRef } from '../NavigationService';
import { useStorage } from '../blue_modules/storage-context';
import { presentWalletExportReminder } from '../helpers/presentWalletExportReminder';
import { useBiometrics } from './useBiometrics';
import { useStorage } from './context/useStorage';
// List of screens that require biometrics
const requiresBiometrics = ['WalletExportRoot', 'WalletXpubRoot', 'ViewEditMultisigCosignersRoot', 'ExportMultisigCoordinationSetupRoot'];

View File

@ -1,7 +1,7 @@
import { useCallback, useContext } from 'react';
import { useCallback } from 'react';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { BlueStorageContext } from '../blue_modules/storage-context';
import { TWallet } from '../class/wallets/types';
import { useStorage } from './context/useStorage';
const useOnAppLaunch = () => {
const STORAGE_KEY = 'ONAPP_LAUNCH_SELECTED_DEFAULT_WALLET_KEY';

View File

@ -1,7 +1,7 @@
import { useEffect, useCallback } from 'react';
// @ts-ignore: react-native-obscure is not in the type definition
import Obscure from 'react-native-obscure';
import { useSettings } from '../components/Context/SettingsContext';
import { useSettings } from './context/useSettings';
export const usePrivacy = () => {
const { isPrivacyBlurEnabled } = useSettings();

View File

@ -1,7 +1,7 @@
import { useEffect, useCallback } from 'react';
// @ts-ignore: react-native-obscure is not in the type definition
import { enabled } from 'react-native-privacy-snapshot';
import { useSettings } from '../components/Context/SettingsContext';
import { useSettings } from './context/useSettings';
export const usePrivacy = () => {
const { isPrivacyBlurEnabled } = useSettings();

View File

@ -2,7 +2,7 @@ import React, { lazy, Suspense } from 'react';
import { LazyLoadingIndicator } from './LazyLoadingIndicator';
const SendDetails = lazy(() => import('../screen/send/details'));
const SendDetails = lazy(() => import('../screen/send/SendDetails'));
const Confirm = lazy(() => import('../screen/send/Confirm'));
const PsbtWithHardwareWallet = lazy(() => import('../screen/send/psbtWithHardwareWallet'));
const CreateTransaction = lazy(() => import('../screen/send/create'));

View File

@ -1,9 +1,8 @@
import 'react-native-gesture-handler'; // should be on top
import React, { lazy, Suspense } from 'react';
import { useStorage } from '../blue_modules/storage-context';
import MainRoot from '../navigation';
import { useStorage } from '../hooks/context/useStorage';
const CompanionDelegates = lazy(() => import('../components/CompanionDelegates'));
const MasterView = () => {

View File

@ -1,11 +1,10 @@
import { createNativeStackNavigator, NativeStackNavigationOptions } from '@react-navigation/native-stack';
import React, { lazy, Suspense } from 'react';
import { isHandset } from '../blue_modules/environment';
import { useStorage } from '../blue_modules/storage-context';
import UnlockWith from '../screen/UnlockWith';
import { LazyLoadingIndicator } from './LazyLoadingIndicator';
import { DetailViewStackParamList } from './DetailViewStackParamList';
import { useStorage } from '../hooks/context/useStorage';
const DetailViewScreensStack = lazy(() => import('./DetailViewScreensStack'));
const DrawerRoot = lazy(() => import('./DrawerRoot'));

View File

@ -1,15 +1,14 @@
import { useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import React, { useContext, useReducer } from 'react';
import React, { useReducer } from 'react';
import { ScrollView } from 'react-native';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../blue_modules/storage-context';
import { BlueCard, BlueLoading, BlueSpacing20, BlueText } from '../BlueComponents';
import presentAlert from '../components/Alert';
import Button from '../components/Button';
import prompt from '../helpers/prompt';
import loc from '../loc';
import { useStorage } from '../hooks/context/useStorage';
// Action Types
const SET_LOADING = 'SET_LOADING';

View File

@ -1,12 +1,12 @@
import React, { useCallback, useEffect, useReducer, useRef } from 'react';
import { ActivityIndicator, Image, StyleSheet, View } from 'react-native';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapticFeedback';
import { useStorage } from '../blue_modules/storage-context';
import { BlueTextCentered } from '../BlueComponents';
import Button from '../components/Button';
import SafeArea from '../components/SafeArea';
import { BiometricType, useBiometrics } from '../hooks/useBiometrics';
import loc from '../loc';
import { useStorage } from '../hooks/context/useStorage';
enum AuthType {
Encrypted,

View File

@ -1,9 +1,7 @@
import { RouteProp, useNavigation, useRoute } from '@react-navigation/native';
import { Psbt } from 'bitcoinjs-lib';
import React, { useContext, useEffect, useRef, useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { Keyboard, SectionList, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueLoading, BlueSpacing10, BlueSpacing20, BlueTextCentered } from '../../BlueComponents';
import { LightningLdkWallet } from '../../class';
import { TWallet } from '../../class/wallets/types';
@ -19,6 +17,7 @@ import confirm from '../../helpers/confirm';
import selectWallet from '../../helpers/select-wallet';
import loc, { formatBalance } from '../../loc';
import { Chain } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
const LdkNodeInfoChannelStatus = { ACTIVE: 'Active', INACTIVE: 'Inactive', PENDING: 'PENDING', STATUS: 'status' };

View File

@ -3,10 +3,8 @@ import BigNumber from 'bignumber.js';
import { Psbt } from 'bitcoinjs-lib';
import React, { useEffect, useRef, useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { btcToSatoshi, fiatToBTC } from '../../blue_modules/currency';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueDismissKeyboardInputAccessory, BlueLoading, BlueSpacing20, BlueText } from '../../BlueComponents';
import { HDSegwitBech32Wallet, LightningLdkWallet } from '../../class';
import AddressInput from '../../components/AddressInput';
@ -19,6 +17,7 @@ import { useTheme } from '../../components/themes';
import { useBiometrics } from '../../hooks/useBiometrics';
import loc from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
type LdkOpenChannelProps = RouteProp<
{

View File

@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
import {
ActivityIndicator,
I18nManager,
@ -16,11 +16,9 @@ import {
} from 'react-native';
import { Icon } from 'react-native-elements';
import { parse } from 'url'; // eslint-disable-line n/no-deprecated-api
import { btcToSatoshi, fiatToBTC, satoshiToBTC } from '../../blue_modules/currency';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import Notifications from '../../blue_modules/notifications';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueDismissKeyboardInputAccessory, BlueLoading } from '../../BlueComponents';
import Lnurl from '../../class/lnurl';
import presentAlert from '../../components/Alert';
@ -32,6 +30,7 @@ import { requestCameraAuthorization } from '../../helpers/scan-qr';
import loc, { formatBalance, formatBalancePlain, formatBalanceWithoutSuffix } from '../../loc';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import * as NavigationService from '../../NavigationService';
import { useStorage } from '../../hooks/context/useStorage';
const LNDCreateInvoice = () => {
const { wallets, saveToDisk, setSelectedWalletID } = useStorage();

View File

@ -1,8 +1,6 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useContext, useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { Share, StyleSheet, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueLoading, BlueSpacing20, BlueText } from '../../BlueComponents';
import presentAlert from '../../components/Alert';
import Button from '../../components/Button';
@ -11,6 +9,7 @@ import QRCodeComponent from '../../components/QRCodeComponent';
import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const LNDViewAdditionalInvoiceInformation = () => {
const { walletID } = useRoute().params;

View File

@ -1,11 +1,9 @@
import { useNavigation, useNavigationState, useRoute } from '@react-navigation/native';
import React, { useContext, useEffect, useRef, useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { useNavigationState, useRoute } from '@react-navigation/native';
import { BackHandler, I18nManager, Image, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import Share from 'react-native-share';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueLoading, BlueSpacing20, BlueText, BlueTextCentered } from '../../BlueComponents';
import Button from '../../components/Button';
import CopyTextToClipboard from '../../components/CopyTextToClipboard';
@ -16,13 +14,15 @@ import loc from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { SuccessView } from '../send/success';
import LNDCreateInvoice from './lndCreateInvoice';
import { useStorage } from '../../hooks/context/useStorage';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
const LNDViewInvoice = () => {
const { invoice, walletID } = useRoute().params;
const { wallets, setSelectedWalletID, fetchAndSaveWalletTransactions } = useStorage();
const wallet = wallets.find(w => w.getID() === walletID);
const { colors, closeImage } = useTheme();
const { goBack, navigate, setParams, setOptions, getParent } = useNavigation();
const { goBack, navigate, setParams, setOptions, getParent } = useExtendedNavigation();
const [isLoading, setIsLoading] = useState(typeof invoice === 'string');
const [isFetchingInvoices, setIsFetchingInvoices] = useState(true);
const [invoiceStatusChanged, setInvoiceStatusChanged] = useState(false);

View File

@ -1,10 +1,8 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useMemo, useState } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import { I18nManager, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import URL from 'url';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueCard, BlueLoading, BlueSpacing20, BlueSpacing40, BlueText } from '../../BlueComponents';
import Lnurl from '../../class/lnurl';
import Button from '../../components/Button';
@ -15,6 +13,7 @@ import selectWallet from '../../helpers/select-wallet';
import loc from '../../loc';
import { Chain } from '../../models/bitcoinUnits';
import { SuccessView } from '../send/success';
import { useStorage } from '../../hooks/context/useStorage';
const AuthState = {
USER_PROMPT: 0,

View File

@ -1,5 +1,5 @@
import { useFocusEffect, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import {
BackHandler,
InteractionManager,
@ -17,7 +17,6 @@ import * as BlueElectrum from '../../blue_modules/BlueElectrum';
import { fiatToBTC, satoshiToBTC } from '../../blue_modules/currency';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import Notifications from '../../blue_modules/notifications';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueButtonLink, BlueCard, BlueLoading, BlueSpacing20, BlueSpacing40, BlueText } from '../../BlueComponents';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';
import AmountInput from '../../components/AmountInput';
@ -32,6 +31,7 @@ import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc, { formatBalance } from '../../loc';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { SuccessView } from '../send/success';
import { useStorage } from '../../hooks/context/useStorage';
const ReceiveDetails = () => {
const { walletID, address } = useRoute().params;

View File

@ -1,4 +1,4 @@
import React, { useContext, useEffect, useMemo, useReducer } from 'react';
import React, { useEffect, useMemo, useReducer } from 'react';
import { ActivityIndicator, FlatList, TouchableOpacity, StyleSheet, Switch, View } from 'react-native';
import { Text } from 'react-native-elements';
import { PayjoinClient } from 'payjoin-client';
@ -8,7 +8,6 @@ import { BlueText, BlueCard } from '../../BlueComponents';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import loc, { formatBalance, formatBalanceWithoutSuffix } from '../../loc';
import Notifications from '../../blue_modules/notifications';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { useRoute, RouteProp } from '@react-navigation/native';
import presentAlert from '../../components/Alert';
import { useTheme } from '../../components/themes';
@ -24,6 +23,7 @@ import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { SendDetailsStackParamList } from '../../navigation/SendDetailsStackParamList';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { ContactList } from '../../class/contact-list';
import { useStorage } from '../../hooks/context/useStorage';
enum ActionType {
SET_LOADING = 'SET_LOADING',

View File

@ -2,7 +2,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import { RouteProp, StackActions, useFocusEffect, useRoute } from '@react-navigation/native';
import BigNumber from 'bignumber.js';
import * as bitcoin from 'bitcoinjs-lib';
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import {
ActivityIndicator,
Alert,
@ -29,7 +29,6 @@ import RNFS from 'react-native-fs';
import { btcToSatoshi, fiatToBTC } from '../../blue_modules/currency';
import * as fs from '../../blue_modules/fs';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueDismissKeyboardInputAccessory, BlueLoading, BlueText } from '../../BlueComponents';
import { HDSegwitBech32Wallet, MultisigHDWallet, WatchOnlyWallet } from '../../class';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';
@ -57,6 +56,7 @@ import { SendDetailsStackParamList } from '../../navigation/SendDetailsStackPara
import { isTablet } from '../../blue_modules/environment';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { ContactList } from '../../class/contact-list';
import { useStorage } from '../../hooks/context/useStorage';
interface IPaymentDestinations {
address: string; // btc address or payment code

View File

@ -1,6 +1,6 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import PropTypes from 'prop-types';
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import {
ActivityIndicator,
FlatList,
@ -18,9 +18,7 @@ import {
} from 'react-native';
import { Avatar, Badge, Icon, ListItem as RNElementsListItem } from 'react-native-elements';
import * as RNLocalize from 'react-native-localize';
import debounce from '../../blue_modules/debounce';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueSpacing10, BlueSpacing20 } from '../../BlueComponents';
import BottomModal from '../../components/BottomModal';
import Button from '../../components/Button';
@ -30,6 +28,7 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc, { formatBalance } from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
const FrozenBadge = () => {
const { colors } = useTheme();

View File

@ -1,12 +1,11 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useEffect, useState } from 'react';
import { useRoute } from '@react-navigation/native';
import BigNumber from 'bignumber.js';
import * as bitcoin from 'bitcoinjs-lib';
import React, { useContext, useEffect, useState } from 'react';
import { FlatList, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import { satoshiToBTC, satoshiToLocalCurrency } from '../../blue_modules/currency';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueCard, BlueText } from '../../BlueComponents';
import presentAlert from '../../components/Alert';
import Button from '../../components/Button';
@ -14,6 +13,8 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
const shortenAddress = addr => {
return addr.substr(0, Math.floor(addr.length / 2) - 1) + '\n' + addr.substr(Math.floor(addr.length / 2) - 1, addr.length);
@ -21,7 +22,7 @@ const shortenAddress = addr => {
const PsbtMultisig = () => {
const { wallets } = useStorage();
const { navigate, setParams } = useNavigation();
const { navigate, setParams } = useExtendedNavigation();
const { colors } = useTheme();
const [flatListHeight, setFlatListHeight] = useState(0);
const { walletID, psbtBase64, memo, receivedPSBTBase64, launchedBy } = useRoute().params;

View File

@ -12,12 +12,12 @@ import {
} from '../../blue_modules/currency';
import { BlueCard, BlueSpacing10, BlueText } from '../../BlueComponents';
import presentAlert from '../../components/Alert';
import { useSettings } from '../../components/Context/SettingsContext';
import ListItem from '../../components/ListItem';
import { useTheme } from '../../components/themes';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc from '../../loc';
import { FiatUnit, FiatUnitSource, FiatUnitType, getFiatRate } from '../../models/fiatUnit';
import { useSettings } from '../../hooks/context/useSettings';
dayjs.extend(calendar);

View File

@ -2,13 +2,12 @@ import { useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import React, { useEffect, useReducer } from 'react';
import { ScrollView, TouchableWithoutFeedback, View } from 'react-native';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueText } from '../../BlueComponents';
import { TWallet } from '../../class/wallets/types';
import ListItem from '../../components/ListItem';
import useOnAppLaunch from '../../hooks/useOnAppLaunch';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
type RootStackParamList = {
SelectWallet: { onWalletSelect: (wallet: TWallet) => void; onChainRequireSend: boolean };

View File

@ -3,7 +3,6 @@ import { Alert, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, Toucha
import { StackActions } from '@react-navigation/native';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueSpacing20, BlueText } from '../../BlueComponents';
import presentAlert from '../../components/Alert';
import ListItem from '../../components/ListItem';
@ -12,6 +11,7 @@ import prompt from '../../helpers/prompt';
import { useBiometrics } from '../../hooks/useBiometrics';
import loc from '../../loc';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { useStorage } from '../../hooks/context/useStorage';
enum ActionType {
SetLoading = 'SET_LOADING',

View File

@ -1,13 +1,12 @@
import { useNavigation } from '@react-navigation/native';
import React from 'react';
import { Platform, ScrollView, StyleSheet } from 'react-native';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueSpacing20, BlueText } from '../../BlueComponents';
import { useSettings } from '../../components/Context/SettingsContext';
import ListItem, { PressableWrapper } from '../../components/ListItem';
import { useTheme } from '../../components/themes';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
import { useSettings } from '../../hooks/context/useSettings';
const styles = StyleSheet.create({
root: {

View File

@ -1,13 +1,12 @@
import React, { useEffect, useLayoutEffect, useState } from 'react';
import { FlatList, NativeSyntheticEvent, StyleSheet } from 'react-native';
import presentAlert from '../../components/Alert';
import { useSettings } from '../../components/Context/SettingsContext';
import ListItem from '../../components/ListItem';
import { useTheme } from '../../components/themes';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc from '../../loc';
import { AvailableLanguages, TLanguage } from '../../loc/languages';
import { useSettings } from '../../hooks/context/useSettings';
const Language = () => {
const { setLanguageStorage, language } = useSettings();

View File

@ -1,11 +1,10 @@
import React from 'react';
import { Platform, ScrollView, StyleSheet } from 'react-native';
import { useSettings } from '../../components/Context/SettingsContext';
import { Header } from '../../components/Header';
import ListItem from '../../components/ListItem';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc from '../../loc';
import { useSettings } from '../../hooks/context/useSettings';
const styles = StyleSheet.create({
root: {

View File

@ -1,16 +1,15 @@
import React, { useContext, useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { Platform, Pressable, ScrollView, StyleSheet, Text, TouchableWithoutFeedback, View } from 'react-native';
import { openSettings } from 'react-native-permissions';
import A from '../../blue_modules/analytics';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueCard, BlueSpacing20, BlueSpacing40, BlueText } from '../../BlueComponents';
import { useSettings } from '../../components/Context/SettingsContext';
import { Header } from '../../components/Header';
import ListItem from '../../components/ListItem';
import { useTheme } from '../../components/themes';
import { setBalanceDisplayAllowed } from '../../components/WidgetCommunication';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
import { useSettings } from '../../hooks/context/useSettings';
enum SettingsPrivacySection {
None,

View File

@ -1,13 +1,10 @@
import React from 'react';
import Clipboard from '@react-native-clipboard/clipboard';
import { useNavigation } from '@react-navigation/native';
import React, { useContext } from 'react';
import { Alert, Image, Linking, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, useWindowDimensions, View } from 'react-native';
import { getApplicationName, getBuildNumber, getBundleId, getUniqueIdSync, getVersion, hasGmsSync } from 'react-native-device-info';
import { Icon } from 'react-native-elements';
import Rate, { AndroidMarket } from 'react-native-rate';
import A from '../../blue_modules/analytics';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueCard, BlueSpacing20, BlueTextCentered } from '../../BlueComponents';
import { HDSegwitBech32Wallet } from '../../class';
import presentAlert from '../../components/Alert';
@ -15,11 +12,13 @@ import Button from '../../components/Button';
import ListItem from '../../components/ListItem';
import { useTheme } from '../../components/themes';
import loc, { formatStringAddTwoWhiteSpaces } from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
const branch = require('../../current-branch.json');
const About = () => {
const { navigate } = useNavigation();
const { navigate } = useExtendedNavigation();
const { colors } = useTheme();
const { width, height } = useWindowDimensions();
const { isElectrumDisabled } = useStorage();

View File

@ -1,13 +1,11 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import Clipboard from '@react-native-clipboard/clipboard';
import { RouteProp, useFocusEffect, useRoute } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import assert from 'assert';
import dayjs from 'dayjs';
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { InteractionManager, Keyboard, Linking, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueCard, BlueLoading, BlueSpacing20, BlueText } from '../../BlueComponents';
import { Transaction, TWallet } from '../../class/wallets/types';
import presentAlert from '../../components/Alert';
@ -20,6 +18,7 @@ import ToolTipMenu from '../../components/TooltipMenu';
import loc from '../../loc';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { DetailViewStackParamList } from '../../navigation/DetailViewStackParamList';
import { useStorage } from '../../hooks/context/useStorage';
interface TransactionDetailsProps {
route: RouteProp<{ params: { hash: string; walletID: string } }, 'params'>;

View File

@ -3,10 +3,8 @@ import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import React, { useEffect, useLayoutEffect, useReducer, useRef } from 'react';
import { ActivityIndicator, BackHandler, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import * as BlueElectrum from '../../blue_modules/BlueElectrum';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueCard, BlueLoading, BlueSpacing10, BlueSpacing20, BlueText } from '../../BlueComponents';
import { HDSegwitBech32Transaction, HDSegwitBech32Wallet } from '../../class';
import { Transaction } from '../../class/wallets/types';
@ -19,6 +17,7 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
enum ButtonStatus {
Possible,

View File

@ -1,6 +1,6 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { useNavigation } from '@react-navigation/native';
import React, { useContext, useEffect, useReducer } from 'react';
import React, { useEffect, useReducer } from 'react';
import {
ActivityIndicator,
Keyboard,
@ -17,7 +17,6 @@ import {
import A from '../../blue_modules/analytics';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueButtonLink, BlueFormLabel, BlueSpacing20, BlueSpacing40, BlueText } from '../../BlueComponents';
import {
BlueApp,
@ -29,13 +28,14 @@ import {
} from '../../class';
import presentAlert from '../../components/Alert';
import Button from '../../components/Button';
import { useSettings } from '../../components/Context/SettingsContext';
import { LdkButton } from '../../components/LdkButton';
import ListItem from '../../components/ListItem';
import { useTheme } from '../../components/themes';
import WalletButton from '../../components/WalletButton';
import loc from '../../loc';
import { Chain } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
import { useSettings } from '../../hooks/context/useSettings';
enum ButtonSelected {
// @ts-ignore: Return later to update
@ -123,7 +123,7 @@ const WalletsAdd: React.FC = () => {
const entropyButtonText = state.entropyButtonText;
//
const colorScheme = useColorScheme();
const { addWallet, saveToDisk, wallets } = useContext(BlueStorageContext);
const { addWallet, saveToDisk, wallets } = useStorage();
const { isAdvancedModeEnabled } = useSettings();
const { navigate, goBack, setOptions } = useNavigation();
const stylesHook = {

View File

@ -1,15 +1,15 @@
import { DrawerContentScrollView } from '@react-navigation/drawer';
import { NavigationProp, ParamListBase, useIsFocused } from '@react-navigation/native';
import React, { memo, useCallback, useContext, useEffect, useMemo, useReducer, useRef } from 'react';
import React, { memo, useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
import { FlatList, InteractionManager, LayoutAnimation, StyleSheet, ViewStyle } from 'react-native';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { TWallet } from '../../class/wallets/types';
import { Header } from '../../components/Header';
import { useTheme } from '../../components/themes';
import WalletsCarousel from '../../components/WalletsCarousel';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
enum WalletActionType {
SetWallets = 'SET_WALLETS',

View File

@ -1,8 +1,6 @@
import { RouteProp, useFocusEffect, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useMemo, useReducer, useRef } from 'react';
import React, { useCallback, useMemo, useReducer, useRef } from 'react';
import { ActivityIndicator, InteractionManager, ScrollView, StyleSheet, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueSpacing20, BlueText } from '../../BlueComponents';
import { TWallet } from '../../class/wallets/types';
import { DynamicQRCode } from '../../components/DynamicQRCode';
@ -11,6 +9,7 @@ import { SquareButton } from '../../components/SquareButton';
import { useTheme } from '../../components/themes';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
type RootStackParamList = {
ExportMultisigCoordinationSetup: {

View File

@ -1,14 +1,12 @@
import React, { useEffect, useMemo, useState } from 'react';
import Clipboard from '@react-native-clipboard/clipboard';
import { RouteProp, useRoute } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import assert from 'assert';
import createHash from 'create-hash';
import React, { useEffect, useMemo, useState } from 'react';
import { SectionList, StyleSheet, Text, View } from 'react-native';
import * as BlueElectrum from '../../blue_modules/BlueElectrum';
import { satoshiToLocalCurrency } from '../../blue_modules/currency';
import { useStorage } from '../../blue_modules/storage-context';
import { BlueButtonLink, BlueLoading } from '../../BlueComponents';
import { HDSegwitBech32Wallet } from '../../class';
import { ContactList } from '../../class/contact-list';
@ -25,6 +23,7 @@ import { BitcoinUnit } from '../../models/bitcoinUnits';
import { PaymentCodeStackParamList } from '../../navigation/PaymentCodeStack';
import SafeArea from '../../components/SafeArea';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { useStorage } from '../../hooks/context/useStorage';
interface DataSection {
title: string;

View File

@ -1,12 +1,11 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useEffect } from 'react';
import { useNavigation, useRoute } from '@react-navigation/native';
import { BackHandler, I18nManager, ScrollView, StyleSheet, Text, View } from 'react-native';
import { useStorage } from '../../blue_modules/storage-context';
import Button from '../../components/Button';
import { useTheme } from '../../components/themes';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const PleaseBackup: React.FC = () => {
const { wallets } = useStorage();

View File

@ -1,5 +1,5 @@
import { useFocusEffect, useRoute } from '@react-navigation/native';
import React, { useCallback, useRef, useState } from 'react';
import { useFocusEffect, useRoute } from '@react-navigation/native';
import {
ActivityIndicator,
Alert,
@ -17,9 +17,7 @@ import {
View,
} from 'react-native';
import { Badge, Icon } from 'react-native-elements';
import { isDesktop, isTablet } from '../../blue_modules/environment';
import { useStorage } from '../../blue_modules/storage-context';
import { encodeUR } from '../../blue_modules/ur';
import {
BlueButtonLink,
@ -35,7 +33,6 @@ import { HDSegwitBech32Wallet, MultisigCosigner, MultisigHDWallet } from '../../
import presentAlert from '../../components/Alert';
import BottomModal from '../../components/BottomModal';
import Button from '../../components/Button';
import { useSettings } from '../../components/Context/SettingsContext';
import MultipleStepsListItem, {
MultipleStepsListItemButtohType,
MultipleStepsListItemDashType,
@ -52,6 +49,8 @@ import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import ActionSheet from '../ActionSheet';
import { useStorage } from '../../hooks/context/useStorage';
import { useSettings } from '../../hooks/context/useSettings';
const ViewEditMultisigCosigners: React.FC = () => {
const hasLoaded = useRef(false);

View File

@ -1,13 +1,11 @@
import { useFocusEffect, useIsFocused, useRoute } from '@react-navigation/native';
import React, { useCallback, useEffect, useReducer, useRef } from 'react';
import { useFocusEffect, useIsFocused, useRoute } from '@react-navigation/native';
import { findNodeHandle, Image, InteractionManager, SectionList, StyleSheet, Text, useWindowDimensions, View } from 'react-native';
import A from '../../blue_modules/analytics';
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 } from '../../blue_modules/storage-context';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';
import { ExtendedTransaction, Transaction, TWallet } from '../../class/wallets/types';
import presentAlert from '../../components/Alert';
@ -23,6 +21,7 @@ import ActionSheet from '../ActionSheet';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { DetailViewStackParamList } from '../../navigation/DetailViewStackParamList';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { useStorage } from '../../hooks/context/useStorage';
const WalletsListSections = { CAROUSEL: 'CAROUSEL', TRANSACTIONS: 'TRANSACTIONS' };

View File

@ -8,11 +8,11 @@ import { BlueSpacing20 } from '../../BlueComponents';
import { MultisigHDWallet } from '../../class';
import BottomModal from '../../components/BottomModal';
import Button from '../../components/Button';
import { useSettings } from '../../components/Context/SettingsContext';
import ListItem from '../../components/ListItem';
import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc from '../../loc';
import { useSettings } from '../../hooks/context/useSettings';
const WalletsAddMultisig = () => {
const { colors } = useTheme();

View File

@ -1,5 +1,5 @@
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import {
ActivityIndicator,
FlatList,
@ -19,14 +19,12 @@ import { Icon } from 'react-native-elements';
import A from '../../blue_modules/analytics';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { encodeUR } from '../../blue_modules/ur';
import { BlueButtonLink, BlueFormMultiInput, BlueSpacing10, BlueSpacing20, BlueText, BlueTextCentered } from '../../BlueComponents';
import { HDSegwitBech32Wallet, MultisigCosigner, MultisigHDWallet } from '../../class';
import presentAlert from '../../components/Alert';
import BottomModal from '../../components/BottomModal';
import Button from '../../components/Button';
import { useSettings } from '../../components/Context/SettingsContext';
import MultipleStepsListItem, {
MultipleStepsListItemButtohType,
MultipleStepsListItemDashType,
@ -40,6 +38,8 @@ import prompt from '../../helpers/prompt';
import { scanQrHelper } from '../../helpers/scan-qr';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
import { useSettings } from '../../hooks/context/useSettings';
const staticCache = {};

View File

@ -1,8 +1,6 @@
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { ActivityIndicator, FlatList, StyleSheet, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { WatchOnlyWallet } from '../../class';
import { AddressItem } from '../../components/addresses/AddressItem';
import { AddressTypeTabs, TABS } from '../../components/addresses/AddressTypeTabs';
@ -10,6 +8,7 @@ import navigationStyle from '../../components/navigationStyle';
import { useTheme } from '../../components/themes';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
export const totalBalance = ({ c, u } = { c: 0, u: 0 }) => c + u;

View File

@ -37,7 +37,6 @@ import { AbstractHDElectrumWallet } from '../../class/wallets/abstract-hd-electr
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import presentAlert from '../../components/Alert';
import Button from '../../components/Button';
import { useSettings } from '../../components/Context/SettingsContext';
import HeaderRightButton from '../../components/HeaderRightButton';
import ListItem from '../../components/ListItem';
import SaveFileButton from '../../components/SaveFileButton';
@ -48,6 +47,7 @@ import { useBiometrics } from '../../hooks/useBiometrics';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { useSettings } from '../../hooks/context/useSettings';
const styles = StyleSheet.create({
scrollViewContent: {

View File

@ -1,8 +1,6 @@
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { ActivityIndicator, AppState, InteractionManager, ScrollView, StyleSheet, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueCard, BlueSpacing20, BlueText } from '../../BlueComponents';
import { LegacyWallet, LightningCustodianWallet, SegwitBech32Wallet, SegwitP2SHWallet, WatchOnlyWallet } from '../../class';
import CopyTextToClipboard from '../../components/CopyTextToClipboard';
@ -12,6 +10,7 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const WalletExport = () => {
const { wallets, saveToDisk } = useStorage();

View File

@ -11,12 +11,12 @@ import {
BlueText,
} from '../../BlueComponents';
import Button from '../../components/Button';
import { useSettings } from '../../components/Context/SettingsContext';
import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import { requestCameraAuthorization } from '../../helpers/scan-qr';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useSettings } from '../../hooks/context/useSettings';
const WalletsImport = () => {
const navigation = useNavigation();

View File

@ -1,9 +1,7 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { FlatList, StyleSheet, TextInput, View } from 'react-native';
import debounce from '../../blue_modules/debounce';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueFormLabel, BlueSpacing20, BlueTextCentered } from '../../BlueComponents';
import { HDLegacyP2PKHWallet, HDSegwitBech32Wallet, HDSegwitP2SHWallet } from '../../class';
import { validateBip32 } from '../../class/wallet-import';
@ -13,6 +11,7 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import WalletToImport from '../../components/WalletToImport';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const WRONG_PATH = 'WRONG_PATH';
const WALLET_FOUND = 'WALLET_FOUND';

View File

@ -1,10 +1,8 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useRoute } from '@react-navigation/native';
import { ActivityIndicator, FlatList, LayoutAnimation, StyleSheet, View } from 'react-native';
import IdleTimerManager from 'react-native-idle-timer';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueButtonLink, BlueFormLabel, BlueSpacing10, BlueSpacing20 } from '../../BlueComponents';
import { HDSegwitBech32Wallet } from '../../class';
import startImport from '../../class/wallet-import';
@ -15,9 +13,11 @@ import { useTheme } from '../../components/themes';
import WalletToImport from '../../components/WalletToImport';
import prompt from '../../helpers/prompt';
import loc from '../../loc';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { useStorage } from '../../hooks/context/useStorage';
const ImportWalletDiscovery = () => {
const navigation = useNavigation();
const navigation = useExtendedNavigation();
const { colors } = useTheme();
const route = useRoute();
const { importText, askPassphrase, searchAccounts } = route.params;

View File

@ -1,14 +1,13 @@
import { useNavigation } from '@react-navigation/native';
import React, { useContext, useState } from 'react';
import React, { useState } from 'react';
import { ActivityIndicator, StyleSheet, TextInput, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueFormLabel, BlueFormMultiInput, BlueSpacing20 } from '../../BlueComponents';
import { HDSegwitBech32Wallet, WatchOnlyWallet } from '../../class';
import presentAlert from '../../components/Alert';
import Button from '../../components/Button';
import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import { useStorage } from '../../hooks/context/useStorage';
const WalletsImportWallet = () => {
const navigation = useNavigation();

View File

@ -1,10 +1,8 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useContext, useEffect, useRef, useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { ScrollView, StyleSheet, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import * as fs from '../../blue_modules/fs';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueLoading, BlueSpacing20, BlueText } from '../../BlueComponents';
import { LightningLdkWallet } from '../../class';
import presentAlert from '../../components/Alert';
@ -12,6 +10,7 @@ import navigationStyle from '../../components/navigationStyle';
import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const LdkViewLogs = () => {
const { colors } = useTheme();

View File

@ -1,8 +1,6 @@
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { BackHandler, ScrollView, StyleSheet, View } from 'react-native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueSpacing20, BlueTextCentered } from '../../BlueComponents';
import Button from '../../components/Button';
import CopyTextToClipboard from '../../components/CopyTextToClipboard';
@ -11,6 +9,7 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const PleaseBackupLNDHub = () => {
const { wallets } = useStorage();

View File

@ -1,9 +1,7 @@
import React, { useCallback, useEffect } from 'react';
import { useNavigation, useRoute } from '@react-navigation/native';
import React, { useCallback, useContext, useEffect } from 'react';
import { BackHandler, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
import QRCode from 'react-native-qrcode-svg';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueSpacing20, BlueTextCentered } from '../../BlueComponents';
import Button from '../../components/Button';
import CopyTextToClipboard from '../../components/CopyTextToClipboard';
@ -11,6 +9,7 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const PleaseBackupLdk = () => {
const { wallets } = useStorage();

View File

@ -1,14 +1,13 @@
import React, { useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
import { Platform, StyleSheet, useColorScheme } from 'react-native';
import DraggableFlatList, { ScaleDecorator } from 'react-native-draggable-flatlist';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { useTheme } from '../../components/themes';
import { WalletCarouselItem } from '../../components/WalletsCarousel';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const styles = StyleSheet.create({
root: {

View File

@ -1,10 +1,8 @@
import { useNavigation, useNavigationState, useRoute } from '@react-navigation/native';
import React, { useContext, useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { ActivityIndicator, FlatList, I18nManager, Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueSpacing20, BlueText } from '../../BlueComponents';
import { LightningCustodianWallet, LightningLdkWallet, MultisigHDWallet } from '../../class';
import WalletGradient from '../../class/wallet-gradient';
@ -13,6 +11,7 @@ import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc, { formatBalance, transactionTimeToReadable } from '../../loc';
import { Chain } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage';
const SelectWallet = () => {
const { chainType, onWalletSelect, availableWallets, noWalletExplanationText, onChainRequireSend = false } = useRoute().params;

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { useRoute } from '@react-navigation/native';
import React, { useContext, useEffect, useState } from 'react';
import {
ActivityIndicator,
Keyboard,
@ -13,15 +13,14 @@ import {
} from 'react-native';
import { Icon } from 'react-native-elements';
import Share from 'react-native-share';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { BlueDoneAndDismissKeyboardInputAccessory, BlueFormLabel, BlueSpacing10, BlueSpacing20, BlueSpacing40 } from '../../BlueComponents';
import presentAlert from '../../components/Alert';
import { FButton, FContainer } from '../../components/FloatButtons';
import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes';
import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
const SignVerify = () => {
const { colors } = useTheme();