Codelabz icon indicating copy to clipboard operation
Codelabz copied to clipboard

[ Fix : Stored the commented_user Id and Used it to Show Avatar ]

Open rohitPandey469 opened this issue 1 year ago • 0 comments

Description

  1. Created a new profile_action getCurrentUserData to fetch user data in TutorialPage component.
  2. Passed the userId to CommentBox component, and update the userId field in commentData to store real userId got from props and then the addComment action get called. Now, the comments have their userId and we can use it to fetch the userData.
  3. Then In Comment component the real userId passed into User component.
  4. Here called the getUserProfileData with the userId and fetched the value and used it to show Avatar.

Now, fetching it inside the component doesn't seem good but we are using the same component for every Avatar's so I am thinking of sending the user data directly into the component. Well, it's something I am just thinking

Related Issue

Fixes #1198

Motivation and Context

Fixing the Avatars so I can differentiate who wrote which/what/why comments.

How Has This Been Tested?

Locally On my machine.

Video:

https://github.com/scorelab/Codelabz/assets/123815256/b9e94567-b32b-4eb5-acd2-c42fa363f2e5

Types of changes

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

Checklist:

  • [x] My code follows the code style of this project.
  • [x] All new and existing tests passed.

rohitPandey469 avatar Feb 19 '24 11:02 rohitPandey469