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:
After:
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?
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:useState
anduseEffect
hooks to manage state and side effects.This refactor addresses issues related to outdated React practices and aims to improve the performance and readability of the code.
Screenshots
Before:
After:
Open questions and concerns