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

[ Feat : The "Add" and "Remove" following options implemented ] #1181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rohitPandey469
Copy link

Description

The isUserFollower and addUserFollower and removeUserFollower which was already present as redux actions, I used it as onClick's function in the fixedData of HomePage ( contributors and who to follow section), and as these functions take two params currentProfile in which the logged in user i.e. Codelabz profile is sent here and the 'profile to follow' in which for the time being I have sent a fixed data of another codelabz account of saogatariju.

Related Issue

Fixes #1177

Motivation and Context

To make things work and smooth like butter.

How Has This Been Tested?

Tested Locally on my machine.

Workings explained:

In first video, Here the follower count and following count for the two users in actions is not updated but just creating or updating the user_followers collection so there is no re render of page as the profileData in HomePage is not updating.

Codelabz.-.Google.Chrome.2024-02-11.22-11-47.mp4

While, in second video, the follower count and following count in profile actions is updated i.e. profileData is getting changed and the normal react comparison is so shallow that it's treating them differently causing the page re render and to avoid it I will be doing memoization in another issue or PR - just for the sake of clean code. And, I would like to think it's changing because of props comparison and if not then memo won't work, so will make a different issue for it.

Codelabz.-.Google.Chrome.2024-02-11.22-09-53.mp4

Here every user is getting changed on one user click because I have sent the same profile data for each one of them and i.e. of saogatariju uid. Check the code

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.

Additional:

If want to see the first video changes then just comment out the update doc part in addUserFollower and removeUserFollower actions.

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.

[ Feat : Follow Button Work at "/" and "/profile" or anywhere ]
1 participant