Codelabz
Codelabz copied to clipboard
[ Fix : Stored the commented_user Id and Used it to Show Avatar ]
Description
- Created a new profile_action
getCurrentUserData
to fetch user data in TutorialPage component. - 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. - Then In Comment component the real userId passed into User component.
- 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.