mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-18 21:35:21 +01:00
FIX: Allow manage list to be scrollable
This commit is contained in:
parent
0ee3da9dc0
commit
56f3ac22c2
@ -38,6 +38,7 @@ interface ManageWalletsListItemProps {
|
||||
handleDeleteWallet: (wallet: TWallet) => void;
|
||||
handleToggleHideBalance: (wallet: TWallet) => void;
|
||||
isActive?: boolean;
|
||||
style?: ViewStyle;
|
||||
}
|
||||
|
||||
interface SwipeContentProps {
|
||||
@ -74,6 +75,7 @@ const ManageWalletsListItem: React.FC<ManageWalletsListItemProps> = ({
|
||||
onPressIn,
|
||||
onPressOut,
|
||||
isActive,
|
||||
style,
|
||||
}) => {
|
||||
const { colors } = useTheme();
|
||||
|
||||
@ -114,7 +116,7 @@ const ManageWalletsListItem: React.FC<ManageWalletsListItemProps> = ({
|
||||
<ListItem.Swipeable
|
||||
leftWidth={80}
|
||||
rightWidth={90}
|
||||
containerStyle={{ backgroundColor: colors.background }}
|
||||
containerStyle={[{ backgroundColor: colors.background }, style]}
|
||||
leftContent={leftContent}
|
||||
rightContent={rightContent}
|
||||
Component={TouchableOpacityWrapper}
|
||||
@ -158,7 +160,6 @@ const ManageWalletsListItem: React.FC<ManageWalletsListItemProps> = ({
|
||||
);
|
||||
}
|
||||
|
||||
console.error('Unrecognized item type:', item);
|
||||
return null;
|
||||
};
|
||||
|
||||
|
@ -430,14 +430,15 @@ const ManageWallets: React.FC = () => {
|
||||
},
|
||||
[goBack, navigate],
|
||||
);
|
||||
|
||||
const renderItem = useCallback(
|
||||
(info: DragListRenderItemInfo<Item>) => {
|
||||
const { item, onDragStart, onDragEnd, isActive } = info;
|
||||
const { item, onDragStart, isActive } = info;
|
||||
return (
|
||||
<ManageWalletsListItem
|
||||
item={item}
|
||||
onPressIn={state.isSearchFocused || state.searchQuery.length > 0 ? undefined : onDragStart}
|
||||
onPressOut={state.isSearchFocused || state.searchQuery.length > 0 ? undefined : onDragEnd}
|
||||
onPressIn={state.isSearchFocused || state.searchQuery.length > 0 ? undefined : undefined}
|
||||
onPressOut={state.isSearchFocused || state.searchQuery.length > 0 ? undefined : undefined}
|
||||
isDraggingDisabled={state.searchQuery.length > 0 || state.isSearchFocused}
|
||||
state={state}
|
||||
navigateToWallet={navigateToWallet}
|
||||
@ -445,7 +446,7 @@ const ManageWallets: React.FC = () => {
|
||||
handleDeleteWallet={handleDeleteWallet}
|
||||
handleToggleHideBalance={handleToggleHideBalance}
|
||||
isActive={isActive}
|
||||
drag={state.isSearchFocused || state.searchQuery.length > 0 ? undefined : onDragStart}
|
||||
drag={onDragStart}
|
||||
/>
|
||||
);
|
||||
},
|
||||
@ -457,6 +458,8 @@ const ManageWallets: React.FC = () => {
|
||||
const copy = [...state.order];
|
||||
const removed = copy.splice(fromIndex, 1);
|
||||
copy.splice(toIndex, 0, removed[0]);
|
||||
|
||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
||||
dispatch({ type: SET_TEMP_ORDER, payload: copy });
|
||||
dispatch({
|
||||
type: SET_INITIAL_ORDER,
|
||||
|
Loading…
Reference in New Issue
Block a user