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

Route user profile #835

Merged
merged 16 commits into from
Jul 20, 2023
Merged

Conversation

NandiniGera
Copy link
Contributor

@NandiniGera NandiniGera commented Jul 15, 2023

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

@NandiniGera
Copy link
Contributor Author

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.
I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

@narayan954
Copy link
Owner

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

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.

@narayan954
Copy link
Owner

narayan954 commented Jul 18, 2023

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

reason it's showing your profile data is because it's not getting external data and defaulting to logged in user data.
The best way to solve this issue imo is to implement dynamic routes asap for profile, so we can just redirect to the dynamic route of that user, and every other detail should be taken care of independently by that page.

Till then, we can pass the state as in other components to the profile page while naviagting! :D

Copy link
Owner

@narayan954 narayan954 left a 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,
Copy link
Owner

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

Copy link
Contributor Author

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

I tried doing that, but it didn't work, thats why i removed that code in the updated commit :/

image

Copy link
Owner

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? :)

Copy link
Contributor Author

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 :)

@NandiniGera
Copy link
Contributor Author

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

reason it's showing your profile data is because it's not getting external data and defaulting to logged in user data. The best way to solve this issue imo is to implement dynamic routes asap for profile, so we can just redirect to the dynamic route of that user, and every other detail should be taken care of independently by that page.

Till then, we can pass the state as in other components to the profile page while naviagting! :D

oohhh okayy got it:)

@NandiniGera
Copy link
Contributor Author

I've marked where the problem currently is

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

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.

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 :/

@narayan954
Copy link
Owner

narayan954 commented Jul 18, 2023

I've marked where the problem currently is

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

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.

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 .
So you can just redirect to the correct username, rest is handled on its own :D

@narayan954 narayan954 linked an issue Jul 18, 2023 that may be closed by this pull request
4 tasks
@NandiniGera
Copy link
Contributor Author

I've marked where the problem currently is

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

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.

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 . So you can just redirect to the correct username, rest is handled on its own :D

okayy thats great!

@narayan954 narayan954 mentioned this pull request Jul 18, 2023
4 tasks
@narayan954
Copy link
Owner

I've marked where the problem currently is

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

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.

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 . So you can just redirect to the correct username, rest is handled on its own :D

okayy thats great!

Hi @NandiniGera is there any blocker?

@NandiniGera
Copy link
Contributor Author

I've marked where the problem currently is

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

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.

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 . So you can just redirect to the correct username, rest is handled on its own :D

okayy thats great!

Hi @NandiniGera is there any blocker?

Actually I updated the code, but it isn't working :/
I've added the commit

@narayan954
Copy link
Owner

I've marked where the problem currently is

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. I guess the avatar is not fetched right now acc. to the code, I made another issue yesterday on changing the account circle icon with the user's profile pic in the comments, can I correct this with that issue itself?

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.

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 . So you can just redirect to the correct username, rest is handled on its own :D

okayy thats great!

Hi @NandiniGera is there any blocker?

Actually I updated the code, but it isn't working :/ I've added the commit

aight checking

Copy link
Owner

@narayan954 narayan954 left a 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!

@narayan954 narayan954 merged commit 8040a7c into narayan954:master Jul 20, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

User Profile from Comments
2 participants