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

Migration from Class to Functional Components(Week.jsx) file. #5833

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

abhay-dev2901
Copy link

@abhay-dev2901 abhay-dev2901 commented Jun 16, 2024

NOTE: Please review the pull request process before opening your first PR: https://github.com/WikiEducationFoundation/WikiEduDashboard/blob/master/CONTRIBUTING.md#pull-request-process

What this PR does

This PR refactors the Week.jsx component from a class-based component to a functional component using React hooks. It maintains all the original functionalities while following the latest React guidelines. The changes include:

  • Migrating the component from a class-based structure to a functional structure.
  • Using useState and useEffect hooks to manage state and side effects.
  • Ensuring the component still handles adding, deleting, and focusing blocks, as well as managing week titles and meeting dates.
  • Maintaining proper sorting of blocks and rendering them accordingly.
  • Adding necessary comments for better code readability and maintainability.

This refactor addresses issues related to outdated React practices and aims to improve the performance and readability of the code.

Screenshots

Before:
WhatsApp Image 2024-07-03 at 3 05 23 PM

After:

WhatsApp Image 2024-07-03 at 3 05 23 PM

Open questions and concerns

  • Ensured that the refactor does not introduce any regressions in functionality.
  • Verified that the component behaves as expected with respect to user interactions like adding, deleting, and focusing blocks.
  • Confirmed that the new functional component aligns with the project’s coding standards and conventions.
  • Are there any additional edge cases or scenarios that need testing to ensure full feature parity with the original class-based component?

@ragesoss
Copy link
Member

Please include screenshots, and do not include unrelated changes to schema.rb in the PR.

@abhay-dev2901
Copy link
Author

OK sir I will fix it

@ragesoss
Copy link
Member

ragesoss commented Jul 1, 2024

This still includes changes to unrelated files.

@abhay-dev2901
Copy link
Author

Plz check now Sir

@abhay-dev2901
Copy link
Author

abhay-dev2901 commented Jul 6, 2024

Hello @ragesoss , Please review this PR

@ragesoss
Copy link
Member

Looks like there's an error that breaks the JS tests.

@abhay-dev2901
Copy link
Author

@ragesoss Please review this PR now

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