mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-12 18:51:21 +01:00
REF: ManageWallets
This commit is contained in:
parent
64c1114dbc
commit
6289485ff9
8 changed files with 28 additions and 22 deletions
|
@ -484,7 +484,8 @@
|
|||
"list_tryagain": "Try again",
|
||||
"no_ln_wallet_error": "Before paying a Lightning invoice, you must first add a Lightning wallet.",
|
||||
"looks_like_bip38": "This looks like a password-protected private key (BIP38).",
|
||||
"reorder_title": "Re-order Wallets",
|
||||
"manage_title": "Manage Wallets",
|
||||
"no_results_found": "No results found.",
|
||||
"please_continue_scanning": "Please continue scanning.",
|
||||
"select_no_bitcoin": "There are currently no Bitcoin wallets available.",
|
||||
"select_no_bitcoin_exp": "A Bitcoin wallet is required to refill Lightning wallets. Please create or import one.",
|
||||
|
@ -495,7 +496,7 @@
|
|||
"add_ln_wallet_first": "You must first add a Lightning wallet.",
|
||||
"identity_pubkey": "Identity Pubkey",
|
||||
"xpub_title": "Wallet XPUB",
|
||||
"search_wallets": "Search wallets, memos, and transactions",
|
||||
"search_wallets": "Search wallets, memos, and transactions"
|
||||
},
|
||||
"multisig": {
|
||||
"multisig_vault": "Vault",
|
||||
|
|
|
@ -55,7 +55,6 @@ import PaymentCodesListComponent from './LazyLoadPaymentCodeStack';
|
|||
import LDKOpenChannelRoot from './LDKOpenChannelStack';
|
||||
import LNDCreateInvoiceRoot from './LNDCreateInvoiceStack';
|
||||
import ReceiveDetailsStackRoot from './ReceiveDetailsStack';
|
||||
import ReorderWalletsStackRoot from './ReorderWalletsStack';
|
||||
import ScanLndInvoiceRoot from './ScanLndInvoiceStack';
|
||||
import ScanQRCodeStackRoot from './ScanQRCodeStack';
|
||||
import SendDetailsStack from './SendDetailsStack';
|
||||
|
@ -66,6 +65,7 @@ import WalletXpubStackRoot from './WalletXpubStack';
|
|||
import PlusIcon from '../components/icons/PlusIcon';
|
||||
import SettingsButton from '../components/icons/SettingsButton';
|
||||
import ExportMultisigCoordinationSetupStack from './ExportMultisigCoordinationSetupStack';
|
||||
import ManageWalletsStackRoot from './ManageWalletsStack';
|
||||
|
||||
const DetailViewStackScreensStack = () => {
|
||||
const theme = useTheme();
|
||||
|
@ -379,8 +379,8 @@ const DetailViewStackScreensStack = () => {
|
|||
}}
|
||||
/>
|
||||
<DetailViewStack.Screen
|
||||
name="ReorderWallets"
|
||||
component={ReorderWalletsStackRoot}
|
||||
name="ManageWalletsRoot"
|
||||
component={ManageWalletsStackRoot}
|
||||
options={{
|
||||
headerShown: false,
|
||||
gestureEnabled: false,
|
||||
|
|
|
@ -103,5 +103,5 @@ export type DetailViewStackParamList = {
|
|||
paymentCode: string;
|
||||
walletID: string;
|
||||
};
|
||||
ReorderWallets: undefined;
|
||||
ManageWalletsRoot: undefined;
|
||||
};
|
||||
|
|
|
@ -4,27 +4,27 @@ import React from 'react';
|
|||
import navigationStyle from '../components/navigationStyle';
|
||||
import { useTheme } from '../components/themes';
|
||||
import loc from '../loc';
|
||||
import ReorderWallets from '../screen/wallets/ReorderWallets';
|
||||
import ManageWallets from '../screen/wallets/ManageWallets';
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
const ReorderWalletsStackRoot = () => {
|
||||
const ManageWalletsStackRoot = () => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<Stack.Navigator screenOptions={{ headerShadowVisible: false }}>
|
||||
<Stack.Screen
|
||||
name="ReorderWalletsScreen"
|
||||
component={ReorderWallets}
|
||||
name="ManageWallets"
|
||||
component={ManageWallets}
|
||||
options={navigationStyle({
|
||||
headerBackVisible: false,
|
||||
headerLargeTitle: true,
|
||||
|
||||
headerTitle: loc.wallets.reorder_title,
|
||||
headerTitle: loc.wallets.manage_title,
|
||||
})(theme)}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
);
|
||||
};
|
||||
|
||||
export default ReorderWalletsStackRoot;
|
||||
export default ManageWalletsStackRoot;
|
|
@ -213,5 +213,5 @@ export type DetailViewStackParamList = {
|
|||
paymentCode: string;
|
||||
walletID: string;
|
||||
};
|
||||
ReorderWallets: undefined;
|
||||
ManageWallets: undefined;
|
||||
};
|
||||
|
|
|
@ -124,7 +124,7 @@ const DrawerList: React.FC<DrawerListProps> = memo(({ navigation }) => {
|
|||
|
||||
const handleLongPress = useCallback(() => {
|
||||
if (state.wallets.length > 1) {
|
||||
navigation.navigate('ReorderWallets');
|
||||
navigation.navigate('ManageWalletsRoot');
|
||||
} else {
|
||||
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect, useLayoutEffect, useRef, useReducer, useCallback, useMemo } from 'react';
|
||||
import { Platform, StyleSheet, useColorScheme, TouchableOpacity, Image, Animated, Text, I18nManager } from 'react-native';
|
||||
// @ts-ignore: fix later
|
||||
// @ts-ignore: no declaration file
|
||||
import DraggableFlatList, { ScaleDecorator } from 'react-native-draggable-flatlist';
|
||||
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
||||
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
|
||||
|
@ -101,7 +101,7 @@ const useBounceAnimation = (query: string) => {
|
|||
return bounceAnim;
|
||||
};
|
||||
|
||||
const ReorderWallets: React.FC = () => {
|
||||
const ManageWallets: React.FC = () => {
|
||||
const sortableList = useRef(null);
|
||||
const { colors, closeImage } = useTheme();
|
||||
const { wallets, setWalletsWithNewOrder, txMetadata } = useStorage();
|
||||
|
@ -116,6 +116,9 @@ const ReorderWallets: React.FC = () => {
|
|||
tip: {
|
||||
backgroundColor: colors.ballOutgoingExpired,
|
||||
},
|
||||
noResultsText: {
|
||||
color: colors.foregroundColor,
|
||||
},
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -284,12 +287,14 @@ const ReorderWallets: React.FC = () => {
|
|||
|
||||
return (
|
||||
<>
|
||||
{hasWallets && <Header leftText="Wallets" isDrawerList />}
|
||||
{hasTransactions && <Header leftText="Transactions" isDrawerList />}
|
||||
{!hasWallets && !hasTransactions && <Text style={styles.noResultsText}>No results found</Text>}
|
||||
{hasWallets && <Header leftText={loc.wallets.wallets} isDrawerList />}
|
||||
{hasTransactions && <Header leftText={loc.addresses.transactions} isDrawerList />}
|
||||
{!hasWallets && !hasTransactions && (
|
||||
<Text style={[styles.noResultsText, stylesHook.noResultsText]}>{loc.wallets.no_results_found}</Text>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}, [state.searchQuery, state.walletData, state.txMetadata]);
|
||||
}, [state.searchQuery, state.walletData.length, state.txMetadata, stylesHook.noResultsText]);
|
||||
|
||||
return (
|
||||
<GestureHandlerRootView style={[styles.root, stylesHook.root]}>
|
||||
|
@ -311,7 +316,7 @@ const ReorderWallets: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default ReorderWallets;
|
||||
export default ManageWallets;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
root: {
|
|
@ -229,7 +229,7 @@ const WalletsList: React.FC = () => {
|
|||
|
||||
const handleLongPress = useCallback(() => {
|
||||
if (wallets.length > 1) {
|
||||
navigate('ReorderWallets');
|
||||
navigate('ManageWalletsRoot');
|
||||
} else {
|
||||
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue