mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 09:50:15 +01:00
ADD: Navigate to selected wallet
This commit is contained in:
parent
fe89b10e50
commit
24bade8862
@ -31,19 +31,11 @@ type RNGHFlatListProps<T> = Animated.AnimateProps<
|
||||
}
|
||||
>;
|
||||
|
||||
const AnimatedFlatList = (Animated.createAnimatedComponent(FlatList) as unknown) as <T>(props: RNGHFlatListProps<T>) => React.ReactElement;
|
||||
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) as unknown as <T>(props: RNGHFlatListProps<T>) => React.ReactElement;
|
||||
|
||||
function DraggableFlatListInner<T>(props: DraggableFlatListProps<T>) {
|
||||
const {
|
||||
cellDataRef,
|
||||
containerRef,
|
||||
flatListRef,
|
||||
isTouchActiveRef,
|
||||
keyToIndexRef,
|
||||
panGestureHandlerRef,
|
||||
propsRef,
|
||||
scrollOffsetRef,
|
||||
} = useRefs<T>();
|
||||
const { cellDataRef, containerRef, flatListRef, isTouchActiveRef, keyToIndexRef, panGestureHandlerRef, propsRef, scrollOffsetRef } =
|
||||
useRefs<T>();
|
||||
const {
|
||||
activationDistance,
|
||||
activeCellOffset,
|
||||
|
@ -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';
|
||||
@ -78,6 +78,8 @@ const ReorderWallets = () => {
|
||||
const sortableList = useRef();
|
||||
const { colors } = useTheme();
|
||||
const { wallets, setWalletsWithNewOrder } = useContext(BlueStorageContext);
|
||||
|
||||
const { navigate } = useNavigation();
|
||||
const stylesHook = {
|
||||
root: {
|
||||
backgroundColor: colors.elevated,
|
||||
@ -95,12 +97,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}
|
||||
onPressIn={drag}
|
||||
onLongPress={drag}
|
||||
onPress={() => navigateToWallet(item)}
|
||||
shadowOpacity={40 / 100}
|
||||
shadowOffset={{ width: 0, height: 0 }}
|
||||
shadowRadius={5}
|
||||
|
Loading…
Reference in New Issue
Block a user