lugenx/ecohabit

Refactor MediaCard to HabitCard and modify export style

Closed this issue · 6 comments

lugenx commented

Overview

To improve code readability and maintainability, we should rename this MediaCard component to HabitCard.

Additionally, we should modify the way we are exporting the component to be at the end of the file instead of directly exporting the function. This is more aligned with our codebase. The function should also be refactored into an arrow function for consistency with the rest of our codebase.

This is the where file is located:
client/src/components/Habit/HabitCard.js

Tasks:

  • Rename the MediaCard function to HabitCard.
  • Refactor the HabitCard function to be an arrow function.
  • Move the export statement to the end of the file, i.e., export default HabitCard.
  • Run the app locally, and make sure the component works.

I would like to work on this issue @lugenx , Can you please assign this to me?

lugenx commented

Assigned @shikhar13012001 , thank you 👍. Please feel free to reach out if you have any questions.

@lugenx I have created my PR, can you please review it and let me know if you need any changes :)

lugenx commented

Thank you, that was so quick :) i just responded your pr, just making sure if that component used with the same name in any other file. did you run it after changes?

yeah I just changed the MediaCard to HabitCard. As the export is default so changing the name will not affect overall component. So it should run fine.

lugenx commented

Thank you!