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

chore: Refactor Lessons component to use FlatList for improved perfor… #238

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

Louis454545
Copy link
Contributor

🚀 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].

  • Vous avez testé de build le projet avec vos modifications et ce build a réussi
  • Vous respectez les conventions de codage et de nommage du projet
  • Vous utilisez la tabulation pour l'indentation afin de maintenir un code lisible
  • Cette pull request n'est pas un duplicata d'une autre
  • Cette pull request est prête à être revue (review) et fusionnée (merge)
  • Il n'y a pas de TODO (aka des annotations pour du code manquant) dans vos modifications
  • Il n'y a pas d'erreurs de langue dans votre code (grammaire, vocabulaire, conjugaison, orthographe)
  • Les détails des changements ont été décrits ci-dessous
  • Cette pull-request n'est pas une "breaking-change" (des modifications qui vont entraîner la modification du fonctionnement de certaines fonctionnalités déjà existantes)

Changelogs 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 in src/views/account/Lessons/Lessons.tsx to enhance the user interface and improve performance. The key updates include replacing the InfiniteDatePager with a FlatList, adding new hooks and callback functions, and modifying the loading mechanism for timetable data.

UI Improvements:

  • Replaced the InfiniteDatePager with a FlatList for better performance and smoother horizontal scrolling. (src/views/account/Lessons/Lessons.tsx)

Code Enhancements:

  • Added useCallback for memoizing functions to prevent unnecessary re-renders. (src/views/account/Lessons/Lessons.tsx)
  • Introduced useRef to manage the FlatList reference and handle scrolling programmatically. (src/views/account/Lessons/Lessons.tsx)

Functional Changes:

  • Updated the loadTimetableWeek function call to include an additional parameter for conditional loading. (src/views/account/Lessons/Lessons.tsx)
  • Implemented onViewableItemsChanged and getItemLayout callbacks to manage visible items and optimize list rendering. (src/views/account/Lessons/Lessons.tsx)

Bug Fixes:

  • Fixed the date selection mechanism to update pickerDate and scroll to the selected date in the FlatList. (src/views/account/Lessons/Lessons.tsx)

@Louis454545
Copy link
Contributor Author

ca fix lle scroll sur les lessons

@Rexxt
Copy link
Contributor

Rexxt commented Sep 29, 2024

balance des enregistrements d'écran stp

@Louis454545
Copy link
Contributor Author

balance des enregistrements d'écran stp

att

@Louis454545
Copy link
Contributor Author

balance des enregistrements d'écran stp

screen-20240929-152640.mp4

@Kgeek33
Copy link
Contributor

Kgeek33 commented Sep 29, 2024

LGTM 👍
Tu peux en profiter pour corriger ce bug ? #232 (c'est encore plus aléatoire avec la pr)

@Louis454545
Copy link
Contributor Author

LGTM 👍 Tu peux en profiter pour corriger ce bug ? #232 (c'est encore plus aléatoire avec la pr)

je fais ca apres mdrrr

Copy link
Contributor

@ecnivtwelve ecnivtwelve left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏽

@godetremy godetremy merged commit f1bf21f into PapillonApp:main Oct 4, 2024
@Louis454545 Louis454545 deleted the fix-scrooll branch October 5, 2024 10:15
@Kgeek33 Kgeek33 mentioned this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants