chore: Refactor Lessons component to use FlatList for improved perfor… #238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Nouvelle Pull Request
Proposez vos modifications pour améliorer Papillon
Informations importantes
Merci de vous référer à la documentation sur la contribution si vous avez des questions à propos des pull requests (https://gitbook.getpapillon.xyz/organisation/outils-internes/github)
Checklist d'avant pull request
Veuillez cocher toutes les cases applicables en remplaçant [ ] par [x].
TODO
(aka des annotations pour du code manquant) dans vos modificationsChangelogs proposés
Décrivez les modifications que vous avez effectuées.
Informations supplémentaires
Ajoutez ici toute information supplémentaire si nécessaire.
This pull request introduces significant changes to the
Lessons
component insrc/views/account/Lessons/Lessons.tsx
to enhance the user interface and improve performance. The key updates include replacing theInfiniteDatePager
with aFlatList
, adding new hooks and callback functions, and modifying the loading mechanism for timetable data.UI Improvements:
InfiniteDatePager
with aFlatList
for better performance and smoother horizontal scrolling. (src/views/account/Lessons/Lessons.tsx
)Code Enhancements:
useCallback
for memoizing functions to prevent unnecessary re-renders. (src/views/account/Lessons/Lessons.tsx
)useRef
to manage theFlatList
reference and handle scrolling programmatically. (src/views/account/Lessons/Lessons.tsx
)Functional Changes:
loadTimetableWeek
function call to include an additional parameter for conditional loading. (src/views/account/Lessons/Lessons.tsx
)onViewableItemsChanged
andgetItemLayout
callbacks to manage visible items and optimize list rendering. (src/views/account/Lessons/Lessons.tsx
)Bug Fixes:
pickerDate
and scroll to the selected date in theFlatList
. (src/views/account/Lessons/Lessons.tsx
)