-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Upgrades ProductCard component (adds subjects / GitHub info) [Closes #1782, Closes #1783] #1808
Conversation
conditional upon receiving `gitAccount` and `gitRepo` as props
local-environments
/eth2/get-involved/
Should we add the GitHub icon to make it clearer we're pulling in github data? |
@ryancreatescopy Any thoughts on where to put it? In the component? A separate indicator for each card? One larger indicator for these whole sections? My thought was squeezing more glyphs into a component like this would make it overly complicated (especially if you have both that and the star) and if someone doesn't know what the stars are, they probably don't care about them. Just some thoughts, let me know what you think. Keep in mind I'm gonna work on a component with a horizontal/wrapping 'pill' list for each programming language... still trying to find the best way for it to all fit together nicely. |
This is amazing! Re: the GH icon / star layout, a couple options:
Re: this approach to querying data: |
@samajammin Agree with everything, and you've iterated some of the issues I came across in v1. I originally made this a link until I realized it was already nested (at least when used in a Re: Querying |
Note, links work but there is a nesting issue still which I will address (which will also address the small issue of the background highlighting going away when hovering over the project image). Also, this has not been refactored to use graphql for api calls, and there may be issues with rate limiting for-the-moment. |
/developers/learning-tools/
until API issues fixed
removed redundant font-size style
added DEV boolean to test layout with this on top vs bottom. removed unneeded styling. increased padding by 50% and font size of star count from `xs` to `s`.
turquoise, yellow, mint, pink were all defined with hex strings lacking the leading "#", this corrects it
Updates:
@samajammin @ryancreatescopy ... I think this is just about everything discussed. I'd say it's ready for review. |
One last note: I know it was commented about the use of 'web3' as a subject (ie. Consensys bootcamp). This can obviously be changed, but my reasoning for keeping it in at the moment is because, yes, this is truly javascript or typescript, but if someone knows javascript and they are looking to learn about Ethereum, they may not be interested in just seeing "JavaScript" since it's not obvious by that label alone that it's something new to them. Options: |
reverts `display` back to inline for SubjectContainer to allow native wrapping of tags if list is longer, and removes negative margin-top on pill (adjusted container margin) and adds margin-bottom in case of multiple rows
eliminates need for hard-coding in a color for each subject tag, improving flexibility to add new subjects, and no subjects default to gray. Offset can be used to adjust theme coloring.
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.
This looks really solid! Left a handful of comments, then I think this is ready to merge. Awesome work.
I think there's still some polishing we may want to do re: the programming language tags but I think we wait to tweak that later if needed in a separate PR.
@wackerow just a note for future PRs: whenever possible let's try to isolate changes into individual PRs. I can understand including the programming language tags in this PR since those are also fed from the GitHub API but I would've liked to see that separated. I think keeping this PR focused solely on the GitHub stars widget would have keep the conversation more focused & would have allowed this contribution to get merged faster.
Thanks again!
src/components/GitStars.js
Outdated
import Link from "./Link" | ||
|
||
const Container = styled(Link)` | ||
margin-right: -0.5rem; |
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.
Generally I'm not a fan of negative margin - why is this needed here? If we want these components to be aligned further right, I suggest we reduct the padding of the card content.
src/components/GitStars.js
Outdated
|
||
const GlyphPill = styled(Pill)` | ||
display: flex; | ||
flex-direection: row; |
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.
Typo here, but you can just remove this line (flex-direction
defaults to row
)
openzeppelin: file(relativePath: { eq: "devtools/openzeppelin.png" }) { | ||
...devtoolImage | ||
} | ||
openzeppelinGitHub: github { | ||
repository(owner: "OpenZeppelin", name: "openzeppelin-contracts") { |
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.
repository(owner: "OpenZeppelin", name: "openzeppelin-contracts") { | |
repository(owner: "OpenZeppelin", name: "openzeppelin-sdk") { |
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.
Wrong repo 😄
@@ -274,6 +274,7 @@ const frameworksList = [ | |||
name: "Waffle", | |||
description: | |||
"The most advanced testing lib for smart contracts. Use alone or with Scafold-eth or Hardhat.", | |||
gitHubUrl: "https://github.com/EthWorks/waffle", |
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.
Since we're already using the GitHub API to pull in star counts, we could also use the API to pull in GitHub URL. See example code in my comment below.
fixed warning about {"1rem"} passed to <Icon />, changed to "16px"
removes left-over unused query fragmet
Sorry for delay here, after rebasing the sizing broke. Found what had changed and cleaned up an unnecessary nested div that was causing issues, it now lays out the way it had been, with slight tweaks to align tags after talking with @ryancreatescopy |
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.
This is great! Thanks for your persistence on this 💪
Hooray! haha no problem =) |
Description
Adds pill-like component that pulls GitHub repo star count for projects listed on the site.
Only shows if
gitAccount
andgitRepo
names are passed. Added these props to<ProductCard>
components, and updated the data fed to them for sandboxes and frameworks.Still need to update all of the /eth2/get-involved listings. --Update: done
Related Issue #1782