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

Added Profile page and routing #116

Merged
merged 3 commits into from
Mar 30, 2021

Conversation

Aniket1103
Copy link
Contributor

@Aniket1103 Aniket1103 commented Mar 18, 2021

Related Issue

  • Info about the related issue

Closes: #57

Describe the changes you've made

Give a clear description of what modifications you have made

Routing added
added a button in the navigation bar to view the profile,
Added and linked profile page to the button
On the profile page username and name is being displayed by fetching from the database.

Type of change

What sort of change have you made:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Mention any unusual behaviour of your code (Write NA if not)

Any unusual behaviour of your code

Checklist:

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented on my code, particularly wherever it was hard to understand.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.

Screenshots

Screenshot (96)

Routing added
added a button in navigation bar to view profile
added and linked profile page
In profile page username and name is being displayed by fetching it from database
@Aniket1103
Copy link
Contributor Author

I have resolved all the conflicts
@Utkarsh1999 @avinashkranjan
Project admins and mentors kindly review the PR.

return (
<div className="app">
<BrowserRouter>
<Switch>
<Route exact path="/home" component={Homepage} />
<Route exact path="/home" component={Homepage}/>
<Route path = "/profile" component = { Profile } />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this exact

@abhishek2x
Copy link

Looks good, but currently, the Profile page is mostly static. Post created by the user should be visible on his/her profile. There are a few extensions that you can do:

  • Create a saved collection in firebase storage and store posts saved by the user and populate them under the saved tab on the user's profile
  • Fetch the user's post and populate them under the posts tab on the user's profile.
  • Further Extention is implementing the feature of followers/following.

ps: you can pass the user's id in URL (/profile/{id}, and then fetch the details of the user on the profile page using the ID passes in URL.

@abhishek2x abhishek2x added enhancement New feature or request GSSOC21 Issues created for/by the GirlScript Summer of Code'21 Participants Level3 New features, Major bug fixing labels Mar 23, 2021
@Aniket1103
Copy link
Contributor Author

Ok, @abhishek2x

  • I can try implementing the first one (i.e, displaying saved posts) by creating a new saved collection
  • but as far as 2nd is concerned I did have a thought of doing so but here the problem is that the existing posts collection stored in Cloud Firestore doesn't have a unique user id attached with it. So, how can I fetch posts of a particular user for displaying it under the posts tab?
  • And for displaying followers/following count should I create a new collection for it which will store the list of users under each category i.e. followers/following or should I just store the count and then fetch the same?
  • And lastly, which ID should I pass through the URL? - the random user uid which is being generated during authentication (e.g. 0pY5NCS02ROupi8ZIEJH2gGF0Zo1) or gmail id?

@abhishek2x
Copy link

Hey @Aniket1103, here is some idea that might help:

  • For displaying a user's post on his/her profile, you can add a posted_by field in the post collection, where posted_by=user_id (firebase authentication id).

  • For implementing Followers/following feature. You need to create a separate collection.
    Collection Name => followed_by: user_id; following: user_id;
    Using this collection you can fetch users who are following a specific profile.

  • For URL, you need to pass the user's id that was generated during firebase authentication.

@Aniket1103
Copy link
Contributor Author

Ok @abhishek2x, thanks for the ideas, I'll try implementing the same and will let you know once done.

Copy link
Owner

@avinashkranjan avinashkranjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM..🚩

@avinashkranjan avinashkranjan merged commit 9252519 into avinashkranjan:master Mar 30, 2021
@Aniket1103
Copy link
Contributor Author

Ok, Thank you @avinashkranjan for acknowledging,
and now If I wish to make more advancements in the profile page will I have to make a new issue for the same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request GSSOC21 Issues created for/by the GirlScript Summer of Code'21 Participants Level3 New features, Major bug fixing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GSSoC'21] feature: Adding profile page
3 participants