-
Notifications
You must be signed in to change notification settings - Fork 81
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
Users by badge #5261
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
7af1c40
to
b3f2f6e
Compare
a2a7260
to
18405b7
Compare
b3f2f6e
to
c6e18b3
Compare
@aapeliv Is this ready for review? I can't tell! Feel free to move the status to "PR" if so! |
18405b7
to
8affa65
Compare
c6e18b3
to
f8cdbbc
Compare
This is ready for review now! |
FYI @aapeliv Shirley just added the mobile designs to the description! |
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}
Designed to look the same as the index page
also added some better styling to the instructions text on the index page
1ac2ff2
to
4e89377
Compare
@nabramow: This is now ready for re-review! I addressed your comment and implemented a mobile view |
badgeId?: string; | ||
} | ||
|
||
export default function BadgesPage({ badgeId = undefined }: BadgesPageProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to make BadgesPage a separate file? Easier to scroll through I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean, sorry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah instead of having two components in one file, break it into a separate file.
{isBadgesLoading ? ( | ||
<CenteredSpinner /> | ||
) : badges && badgeId in badges ? ( | ||
<> | ||
<FlexDiv> | ||
<Badge badge={badges[badgeId]} /> | ||
<Typography variant="body1"> | ||
{badges[badgeId].description} | ||
</Typography> | ||
</FlexDiv> | ||
<BadgeUserList badgeId={badgeId} /> | ||
</> | ||
) : ( | ||
<>Badge not found</> | ||
)} | ||
</ContentDiv> | ||
) : ( | ||
<CenteredDiv> | ||
<Typography variant="subtitle1"> | ||
{t("profile:badges.click_on_left")} | ||
</Typography> | ||
</CenteredDiv> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of ternary operators in here. Is there a way to break up this logic to make it more readable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to think about it a bit; to my eye this hits a good balance with not being too conditional but also being readable and concise. I'm not sure how to break it apart in a way that doesn't just separate the logic too much.
Open to suggestions though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I see what you mean, I think it's okay for now as probably this logic won't get more complicated or expanded on much.
@nabramow this is now ready for review again! I think it should be done, fingers crossed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works well for me now on desktop and mobile!
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 pageWeb frontend checklist
yarn format
yarn lint --fix
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!