FIX: Allow manage list to be scrollable

This commit is contained in:
Marcos Rodriguez Velez 2025-01-07 22:20:09 -04:00
parent 0ee3da9dc0
commit 56f3ac22c2
2 changed files with 10 additions and 6 deletions

View File

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

View File

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