Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement react-native-reorderable-list #5351

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Conversation

Jon-edge
Copy link
Collaborator

@Jon-edge Jon-edge commented Nov 8, 2024

Notes:

  • Did not include the patch package from the original rn-sortable-listview integration
  • TODO: Unable to get the useSceneScrollHandler to work with the SortableListView

May need to go with the new library route.

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@swansontec
Copy link
Contributor

Was this tested on iOS? We should definitely do that before merging.

@Jon-edge Jon-edge force-pushed the jon/fix/wallet-reorder branch 2 times, most recently from 698fcfb to ab84ba9 Compare November 9, 2024 20:47
Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes needed, but this looks good.

jestSetup.js Outdated
jest.mock('react-native-reorderable-list', () => ({
...jest.requireActual('react-native-reorderable-list'),
useReorderableDrag: () => jest.fn(),
}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline in file.

@@ -113,3 +113,37 @@ export const useSceneScrollHandler = (): SceneScrollHandler => {

return handler
}

export const useSceneScrollWorkletHandler = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment to this to explain why this is different than the one above.

keyStates[walletId] = { sortIndex: i }
}
account.changeWalletStates(keyStates).catch(error => showError(error))
})

const keyExtractor = (item: string) => item
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a useHandler or useCallback as well.

Copy link
Collaborator Author

@Jon-edge Jon-edge Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a useHandler here somehow broke the feature, not sure why...

Is this ok to leave with just a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured it out, needed to use useCallback

@Jon-edge Jon-edge force-pushed the jon/fix/wallet-reorder branch 2 times, most recently from 06a7961 to 22e402b Compare November 12, 2024 02:06
@Jon-edge Jon-edge changed the title Revert to rn-sortable-listview Implement react-native-reorderable-list Nov 12, 2024
@Jon-edge Jon-edge merged commit 4bb428d into develop Nov 12, 2024
2 checks passed
@Jon-edge Jon-edge deleted the jon/fix/wallet-reorder branch November 12, 2024 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants