ADD: Navigate to selected wallet

This commit is contained in:
Marcos Rodriguez Vélez 2022-01-27 17:32:00 -05:00
parent fe89b10e50
commit 24bade8862
No known key found for this signature in database
GPG Key ID: 0D64671698D11C5C
2 changed files with 17 additions and 13 deletions

View File

@ -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,

View File

@ -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}