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

feat: add user profile page, improve search #184

Merged
merged 1 commit into from
Jun 3, 2021
Merged

Conversation

chriswhong
Copy link
Contributor

Adds user profile routes with two dataset lists:

  • user datasets /:username
  • datasets the user is following /:username/following

Both lists share query params of type UserProfileParams. Introduces a new pattern for query params:

  1. on mount or update, read query params from URL
  2. convert params from the URL into valid UserProfileParams by adding default values
  3. fetch data using UserProfileParams
  4. when user interacts with pagination, query, or sort, etc, modify the UserProfileParams
  5. update the URL with a "cleaned" version of UserProfileParams, (excluding default values)
  6. go to 1

Updates Search to use the same pattern for query params.

TODO:

  • improve loading states
  • add a sticky header on scroll
  • handle no results (e.g. user doesn't follow any datasets)

@chriswhong chriswhong requested review from b5 and ramfox June 3, 2021 03:53
Copy link
Member

@ramfox ramfox left a comment

Choose a reason for hiding this comment

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

One or two style nits I think should be changed, and some questions about naming of our listing params, but since that is an ongoing conversation anyway, not something that needs to be fixed right now: LGMT

frontend/src/features/search/SearchResultItem.tsx Outdated Show resolved Hide resolved
frontend/src/chrome/ExternalLink.tsx Outdated Show resolved Hide resolved
frontend/src/features/userProfile/UserProfileHeader.tsx Outdated Show resolved Hide resolved
frontend/src/features/search/Search.tsx Show resolved Hide resolved
@chriswhong chriswhong merged commit 36c7cbb into master Jun 3, 2021
@chriswhong chriswhong deleted the user-profiles branch June 3, 2021 18:50
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.

2 participants