-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Route user profile #835
Route user profile #835
Conversation
Actually, there's one issue in this- when we click on the username, it navigates to that user's profile correctly but on that user's profile it shows my profile pic(the user who has clicked that username who made the comment) only and not the profile pic of the one who made the comment. |
perhaps, it might be due to the fact we're not passing those details in state while navigating, if I'm correct. If we pass the profile pic, it should render, right? Until we refresh the profile page, ofcourse. |
reason it's showing your profile data is because it's not getting external data and defaulting to logged in user data. Till then, we can pass the state as in other components to the profile page while naviagting! :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've marked where the problem currently is
<span className="comment-doer-name" onClick={() => { | ||
navigate("/dummygram/profile", { | ||
state: { | ||
name: userComment.content.username, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
photo and other details can be passed in this state object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhhh, perhaps some other issue, or component getting refreshed on its own. But dont worry now, route has been made dynamic and you dont need to pass these states at all now!! Amazing, isn't it? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhhh, perhaps some other issue, or component getting refreshed on its own. But dont worry now, route has been made dynamic and you dont need to pass these states at all now!! Amazing, isn't it? :)
Yesss indeed!
Much to learn :)
oohhh okayy got it:) |
I added the state objects again, after refreshing it shows that user's profile pic just for one sec and then back again it shows my profile pic :/ |
listen,no need to worry now, we just implemented the major feature of dynamic profile routes, credits to @Palakkgoyal . |
okayy thats great! |
Hi @NandiniGera is there any blocker? |
Actually I updated the code, but it isn't working :/ |
aight checking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
When we click on the username who has made a comment, it routes to that person's profile now!
I've tried working it on many users as well
Completes issue #796