Skip to content

wmr-SRP example for class and minor UI update on MyHall#2614

Open
jtasonye wants to merge 1 commit intowheres-my-rafrom
wmr-SRP-example
Open

wmr-SRP example for class and minor UI update on MyHall#2614
jtasonye wants to merge 1 commit intowheres-my-rafrom
wmr-SRP-example

Conversation

@jtasonye
Copy link
Contributor

Changes made in PR:

  • Following the Single Responsibility Principle in React, I changed the logic used to generate the RD Link for the MyHall component. SRP states that a component should have one clear responsibility, but looking at our previous useEffect, it had multiple responsibilities (e.g. string manipulation and updating the state setRdProfileLink).
  • By implementing the following fix, generateRDProfileLink is only responsible for the string manipulation to get the profile link and the useEffect is only responsible for state updates now
  • Also, I realized that the My Assigned Rooms text should only be displayed if the user is an RA, so I made some changes to fix that error

@jtasonye jtasonye requested review from Mrand03 and dli505 March 31, 2025 18:48
@jtasonye jtasonye self-assigned this Mar 31, 2025
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.

1 participant