mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-26 08:55:56 +01:00
FIX: Smooth transition
This commit is contained in:
parent
dc44db6ec5
commit
f3b4ac02b0
2 changed files with 7 additions and 11 deletions
|
@ -145,17 +145,11 @@ const WalletCarouselItem = ({ item, _, onPress, handleLongPress, isSelectedWalle
|
|||
const itemWidth = width * 0.82 > 375 ? 375 : width * 0.82;
|
||||
const isLargeScreen = Platform.OS === 'android' ? isTablet() : (width >= Dimensions.get('screen').width / 2 && isTablet()) || isDesktop;
|
||||
const onPressedIn = () => {
|
||||
const props = { duration: 50 };
|
||||
props.useNativeDriver = true;
|
||||
props.toValue = 0.9;
|
||||
Animated.spring(scaleValue, props).start();
|
||||
Animated.spring(scaleValue, { duration: 50, useNativeDriver: true, toValue: 0.9 }).start();
|
||||
};
|
||||
|
||||
const onPressedOut = () => {
|
||||
const props = { duration: 50 };
|
||||
props.useNativeDriver = true;
|
||||
props.toValue = 1.0;
|
||||
Animated.spring(scaleValue, props).start();
|
||||
Animated.spring(scaleValue, { duration: 50, useNativeDriver: true, toValue: 1.0 }).start();
|
||||
};
|
||||
|
||||
const opacity = isSelectedWallet === false ? 0.5 : 1.0;
|
||||
|
@ -201,8 +195,9 @@ const WalletCarouselItem = ({ item, _, onPress, handleLongPress, isSelectedWalle
|
|||
onLongPress={handleLongPress}
|
||||
onPress={() => {
|
||||
onPressedOut();
|
||||
onPress(item);
|
||||
onPressedOut();
|
||||
setTimeout(() => {
|
||||
onPress(item); // Replace 'onPress' with your navigation function
|
||||
}, 50);
|
||||
}}
|
||||
>
|
||||
<LinearGradient shadowColor={colors.shadowColor} colors={WalletGradient.gradientsFor(item.type)} style={iStyles.grad}>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useContext, useEffect, useRef } from 'react';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import { StyleSheet, LayoutAnimation } from 'react-native';
|
||||
import { DrawerContentScrollView } from '@react-navigation/drawer';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useIsFocused } from '@react-navigation/native';
|
||||
|
@ -32,6 +32,7 @@ const DrawerList = props => {
|
|||
const handleClick = item => {
|
||||
if (item?.getID) {
|
||||
const walletID = item.getID();
|
||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
||||
setSelectedWalletID(walletID);
|
||||
props.navigation.navigate({
|
||||
name: 'WalletTransactions',
|
||||
|
|
Loading…
Add table
Reference in a new issue