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

View user profiles #582

Merged
merged 11 commits into from
Nov 16, 2024
Merged

View user profiles #582

merged 11 commits into from
Nov 16, 2024

Conversation

IngvarV8
Copy link
Contributor

@IngvarV8 IngvarV8 commented Nov 10, 2024

WIP, providing /users/:id now should redirect to a new page about user.

Closes #504

Copy link
Collaborator

@wbazant wbazant left a comment

Choose a reason for hiding this comment

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

Thanks for doing this work! I had a bit of fun looking at bios of random users by guessing /users/12345 etc. , and we have a starting point for adding more data for these pages - ideally the changes we want the user to make.

My three requests are to change how the route is set up - currently it doesn't work on mobile -, make the links to user pages a bit more subtle or unset the styling completely for now, and iterate on the styling of the user page a bit, and then I think we'll be ready to merge this.

{review.author && (
<>
{' by '}
{review.user_id ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure how to style this - maybe text-decoration: none (undoing the underline styling) and theme.orange for color?
Screenshot from 2024-11-11 10-24-00

Copy link
Collaborator

Choose a reason for hiding this comment

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

Even undoing all the link styling is an option - then the feature won't be discoverable on mobile for now, and will only be known to be a link on desktop because of pointer cursor, but that's fine, since we don't have much content for the pages yet.


const pages = [
{
path: ['/users/:id'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of this file, could you put the new route in auth routes, just under /users/sign_in etc. ? It doesn't completely belong there, but it'll help us understand the routing. It needs to be below the more specific routes (otherwise /users/sign_in will try to go to a user profile with id "sign_in", and fail).

@@ -7,6 +7,7 @@ import aboutRoutes from '../about/aboutRoutes'
import authRoutes from '../auth/authRoutes'
import connectRoutes from '../connect/connectRoutes'
import MapPage from '../map/MapPage'
import profileRoutes from '../profile/profileRoutes'
Copy link
Collaborator

Choose a reason for hiding this comment

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

You only included it in the desktop layout - let's also have the user pages on mobile :). If you put the new route in authRoutes (see other comment), it'll work for both layouts.

setUserData(data)

// Log the fetched data
console.log('Fetched User Data:', data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's remove this logging statement when the PR is ready to merge

</BackButton>
</StyledNavBack>

<h1>Name: {name}</h1>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a good start since it shows the data!

Can we iterate on the styling a bit, and try to use fewer words, so there's less need to translate them?

My original quick attempt was a <h2>, user icon for the name, a <p> for a bio, and an italic:

Screenshot from 2024-11-11 10-35-39

Screenshot from 2024-11-11 10-34-32

but I'm not great at styling pages.

Maybe borrow the styling from the import page?
It looks like

<h3> #301: Dumpster Diving locations (Melbs)</h3>

with the rest in <p> elements.

@IngvarV8
Copy link
Contributor Author

I have made some changes based on your feedback, particularly:

  • adjusted styling of links and user profile
  • /users/:id route is now a part of authRoutes

@wbazant
Copy link
Collaborator

wbazant commented Nov 13, 2024

Thanks! I checked out the branch again. I realised what you mean about not getting the user ID, it really is sometimes missing - http://localhost:3000/locations/591687 has "Ethan" but no user ID, while http://localhost:3000/locations/1989825 has both author and user ID.

  1. Let's render the name as a link only when we have the user ID, and just the name otherwise.

  2. Link styling on location page

The orange links I suggested are not an improvement. Sorry! For comparison, I looked at an imported location, e.g. http://localhost:3000/locations/1150852 , with a blue link that looks totally fine. Could we instead keep the links in their default style for the location author, and unset the colour on the review author?
Screenshot from 2024-11-13 17-08-00

Would you be up for making some related changes to both the user page and the import page?

  1. joining / import date like in EntryOverview.js: in a <time> tag and
formatISOString(                 ...,        i18n.language     )                                                                       

will style it out nicely.

  1. Headers: let's make them consistent on both pages - <h3>, add the word "Import" to the import page, and "User: " to the user page like your original version.

  2. Content order on user page: let's follow the import page - after the header, have a bio, and use a calendar icon for when the user joined.

@IngvarV8
Copy link
Contributor Author

Hello, I once again implemented and uploaded the changes you mentioned. Let me know as I am not sure if I understood correctly. I changed:

  • link styling
  • time formatting in import and user pages
  • content display on user page

@wbazant wbazant self-requested a review November 14, 2024 19:03
Copy link
Collaborator

@wbazant wbazant left a comment

Choose a reason for hiding this comment

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

Thanks again for working on this and for making the changes I requested! I like the italics for the bio text as well, they're making it clearer that it's the user who wrote this.

Do you want to do any more work on the site as part of this issue / PR? The only other change I see is to maybe remove the icon from the users page - I know I suggested it, but on second thought, it doesn't seem to add anything or look particularly well - unless you think it's worth keeping, then maybe style it to the same height as the text, or maybe start the bio with it instead?

After that, I think we can un-draft the PR and I'll be happy to merge it.

@IngvarV8
Copy link
Contributor Author

Sure, I just uploaded the fix where I moved user icon to bio instead (In my opinion it looks more aligned with the rest of the user attributes). If this fits to be the final solution, I'll create a pull request.

@wbazant
Copy link
Collaborator

wbazant commented Nov 16, 2024

That does look good, and works for various lengths of content as well: http://localhost:3000/users/1 http://localhost:3000/users/12345 http://localhost:3000/users/12 . Thanks for implementing this feature and your work on it! I think we can merge it - if you'd also like to work on something else, feel free to pick an issue from the tracker.

@wbazant wbazant marked this pull request as ready for review November 16, 2024 15:18
@wbazant wbazant self-requested a review November 16, 2024 15:18
@wbazant wbazant merged commit 80c3f1d into falling-fruit:main Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

View user profiles
2 participants