cedricyeeky / orbital_NUShopLah-

0 stars 1 forks source link

Refactor Customer Home Screen - FLatList #12

Open freddychenyouren2 opened 1 year ago

freddychenyouren2 commented 1 year ago

Render Vouchers using FlatList component instead of map. Need to ensure the UI of screen is maintained well.

freddychenyouren2 commented 1 year ago

Cedric attempted to refactor Customer Home Screen to render Available Vouchers using FlatList instead of map. However, our code has become too complex, where our implementation involves calling multiple functions and passing around multiple fields. This made it very challenging to refactor code into FlatList component. While we managed to render the vouchers in a FlatList, the logic behind the buttons are intertwined too much that it is challenging for one function to be completely separated from another.

We admit that this means our code lacks the practice of Separation of Concern that allows for easier testability.

Nevertheless, We shall be exploring ways to test our code with our current implementation.