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

Users by badge #5261

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Conversation

aapeliv
Copy link
Member

@aapeliv aapeliv commented Nov 27, 2024

This builds on top of #5259, which itself builds on #5253 and #5254!

Taking over from #5250. Continues the frontend part of #4389.

TODO:

  • making the badges pretty on the user page

Web frontend checklist

  • Formatted my code with yarn format
  • There are no warnings from yarn lint --fix
  • There are no console warnings when running the app
  • Added any new components to storybook
  • Added tests where relevant
  • All tests pass
  • Clicked around my changes running locally and it works
  • Checked Desktop, Mobile and Tablet screen sizes

Mobile Design
The badges will be aligned and wrapped around. Also made the text white for easier reading against harsh BG colors. Filtering badges only work one at a time as of now. Pls refer to the desktop version for the mini bio of each badge!
Badges _ Mobile View 2

Copy link

vercel bot commented Nov 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
couchers ✅ Ready (Inspect) Visit Preview Dec 16, 2024 4:01am

@aapeliv aapeliv mentioned this pull request Nov 27, 2024
8 tasks
@aapeliv aapeliv added the release notes: pending Add to stuff that should be included in release notes label Nov 27, 2024
@aapeliv aapeliv force-pushed the frontend/feature/users-by-badge-on-user-lists branch from 7af1c40 to b3f2f6e Compare November 27, 2024 15:23
@aapeliv aapeliv force-pushed the frontend/refactor/user-lists branch 2 times, most recently from a2a7260 to 18405b7 Compare November 27, 2024 17:04
@aapeliv aapeliv force-pushed the frontend/feature/users-by-badge-on-user-lists branch from b3f2f6e to c6e18b3 Compare November 27, 2024 17:04
@nabramow
Copy link
Collaborator

nabramow commented Dec 8, 2024

@aapeliv Is this ready for review? I can't tell! Feel free to move the status to "PR" if so!

@aapeliv aapeliv changed the title Users by badge [Blocked] Users by badge Dec 9, 2024
@aapeliv
Copy link
Member Author

aapeliv commented Dec 9, 2024

@nabramow: it's blocked by #5259 which this builds on! I've marked this as blocked for now.

@aapeliv aapeliv force-pushed the frontend/refactor/user-lists branch from 18405b7 to 8affa65 Compare December 10, 2024 21:02
Base automatically changed from frontend/refactor/user-lists to develop December 15, 2024 13:10
@aapeliv aapeliv changed the title [Blocked] Users by badge Users by badge Dec 15, 2024
consolidated hooks for the badges feature
I thought having a clickable chip with a tooltip is a common scenario we
might want to make use of later, so I extracted this functionality
originally built out in the features/profile/view/Badges file into a
ToolChipLink component.

The Badge component is then just a wrapper around that where you pass in
a Badge resource. This uses a URL scheme for badges at /badges/{id}
These are better user-facing descriptions of the available badges
Designed to look the same as the index page
also added some better styling to the instructions text on the index page
@aapeliv aapeliv requested a review from nabramow December 16, 2024 03:59
@aapeliv
Copy link
Member Author

aapeliv commented Dec 16, 2024

This is ready for review now!

Comment on lines +9 to +14
const { data, ...rest } = useQuery(badgesKey, () =>
service.resources.getBadges().then((result) =>
result.badgesList.reduce(
(badgesResult, badge) => {
badgesResult.badges[badge.id] = badge;
return badgesResult;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you switch this over to async await syntax instead? The .then is a bit outdated IMO.

It means you'll need to turn the first into its own variable but that also is more readable.

const useStyles = makeStyles((theme) => ({
badgeContainer: {
marginTop: theme.spacing(1),
},
badge: {
marginInlineStart: theme.spacing(1),
marginBottom: theme.spacing(1),
},
const StyledContainer = styled("div")(({ theme }) => ({
marginTop: theme.spacing(1),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yaaay!

@nabramow
Copy link
Collaborator

Okay finally tested the branch and on Desktop it looks great! But on mobile it looks like this:

Screenshot 2024-12-19 at 9 12 56 PM

I'd suggest making a mobile view that has all the badges up top in a flexbox with wrap, then the userslists rendering below that. Or if you're feeling fancy, put the badges in a select on mobile (tbh wouldn't be bad on desktop either) as there will be quite a few badges.

@nabramow
Copy link
Collaborator

FYI @aapeliv Shirley just added the mobile designs to the description!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.topic frontend release notes: pending Add to stuff that should be included in release notes
Projects
Status: PR
Development

Successfully merging this pull request may close these issues.

3 participants