mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 15:20:55 +01:00
Merge pull request #4433 from BlueWallet/navigate
ADD: Navigate to selected wallet
This commit is contained in:
commit
af3d50cc7a
1 changed files with 13 additions and 1 deletions
|
@ -4,7 +4,7 @@ import { BluePrivateBalance } from '../../BlueComponents';
|
|||
import DraggableFlatList, { ScaleDecorator } from '../../components/react-native-draggable-flatlist';
|
||||
import LinearGradient from 'react-native-linear-gradient';
|
||||
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
||||
import { useTheme } from '@react-navigation/native';
|
||||
import { useNavigation, useTheme } from '@react-navigation/native';
|
||||
import navigationStyle from '../../components/navigationStyle';
|
||||
import { LightningCustodianWallet, LightningLdkWallet, MultisigHDWallet } from '../../class';
|
||||
import WalletGradient from '../../class/wallet-gradient';
|
||||
|
@ -74,6 +74,8 @@ const ReorderWallets = () => {
|
|||
const sortableList = useRef();
|
||||
const { colors } = useTheme();
|
||||
const { wallets, setWalletsWithNewOrder } = useContext(BlueStorageContext);
|
||||
|
||||
const { navigate } = useNavigation();
|
||||
const stylesHook = {
|
||||
root: {
|
||||
backgroundColor: colors.elevated,
|
||||
|
@ -88,12 +90,22 @@ const ReorderWallets = () => {
|
|||
setWalletData(wallets);
|
||||
}, [wallets]);
|
||||
|
||||
const navigateToWallet = wallet => {
|
||||
const walletID = wallet.getID();
|
||||
navigate('WalletTransactions', {
|
||||
walletID,
|
||||
walletType: wallet.type,
|
||||
key: `WalletTransactions-${walletID}`,
|
||||
});
|
||||
};
|
||||
|
||||
const renderItem = ({ item, drag, isActive }) => {
|
||||
return (
|
||||
<ScaleDecorator>
|
||||
<Pressable
|
||||
disabled={isActive}
|
||||
onLongPress={drag}
|
||||
onPress={() => navigateToWallet(item)}
|
||||
shadowOpacity={40 / 100}
|
||||
shadowOffset={{ width: 0, height: 0 }}
|
||||
shadowRadius={5}
|
||||
|
|
Loading…
Add table
Reference in a new issue