-
Notifications
You must be signed in to change notification settings - Fork 26
Story 2212: Contributors List Component #2268
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
base: develop
Are you sure you want to change the base?
Changes from all commits
4be2783
e587175
b372a9f
98ac0c5
73546fd
b8f93a8
9dfc337
ce6c963
6ada127
6dadf46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| .contributors-list :is(h2, h3, h4, h5, h6) { | ||
| margin: 0; | ||
| } | ||
|
|
||
| .contributors-list .card__column { | ||
| gap: var(--space-medium); | ||
| } | ||
|
|
||
| .contributors-list.all-contributors { | ||
| max-width: 100%; | ||
| } | ||
|
|
||
| .contributors-list.all-contributors .card__column { | ||
| display: grid; | ||
| grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); | ||
| gap: var(--space-medium); | ||
| } | ||
|
|
||
| @media (max-width: 768px) { | ||
| .contributors-list.all-contributors .card__column { | ||
| grid-template-columns: 1fr; | ||
| overflow-y: auto; | ||
| } | ||
|
|
||
| .contributors-list { | ||
| max-height: 80vh; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| {% comment %} | ||
| Vertical list showing all contributors to a library or release. | ||
| Has two variants: Contributors in release, or all contributors. The release variant is a single column, | ||
| all contributors is a differing number of columns depending on screen size. | ||
|
|
||
| Inputs: | ||
| - title: str, required - top title of card | ||
| - variant: str, required - choice of release or all, determines display layout | ||
| - contributors: list, required - List of contributors, matching the author input of _user_profile.html | ||
| - heading_level: int, optional - Set the semantic leve of the heading, defaults to 2, does not allow for h1 | ||
|
|
||
| Usage: | ||
| {% include "v3/includes/_contributors_list.html" with title="Contributors: This Release" variant="release" contributors=contributors %} | ||
| {% endcomment %} | ||
| <div class="basic-card card py-large contributors-list {% if variant == 'all' %} all-contributors {% endif %}"> | ||
| <div class="card__header"> | ||
| {% if heading_level == '2' or not heading_level %} | ||
| <h2 class="card__title">{{ title }}</h2> | ||
| {% elif heading_level == '3' %} | ||
| <h3 class="card__title">{{ title }}</h3> | ||
| {% elif heading_level == '4' %} | ||
| <h4 class="card__title">{{ title }}</h4> | ||
| {% elif heading_level == '5' %} | ||
| <h5 class="card__title">{{ title }}</h5> | ||
| {% elif heading_level == '6' %} | ||
| <h6 class="card__title">{{ title }}</h6> | ||
| {% endif %} | ||
| </div> | ||
| <hr class="card__hr" /> | ||
| <div class="card__column px-large"> | ||
| {% for contributor in contributors %} | ||
| {% include "v3/includes/_user_profile.html" with author=contributor only %} | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,10 +14,10 @@ | |
| <div class="user-profile{% if author.bio %} user-profile--has-bio{% endif %}" role="group" aria-label="{{ author.name }}"> | ||
| {% if author.profile_url %} | ||
| <a href="{{ author.profile_url }}" class="user-profile__avatar-link"> | ||
| {% include "v3/includes/_avatar_v3.html" with src=author.avatar_url name=author.name size="xl" %} | ||
| {% include "v3/includes/_avatar_v3.html" with src=author.avatar_url name=author.name size="xl" only %} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. Were you seeing a context leak, or is this just proactive? Should we be doing this other places we pass props to components?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did get a context leak, since I was also use a
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something to share with the team! |
||
| </a> | ||
| {% else %} | ||
| {% include "v3/includes/_avatar_v3.html" with src=author.avatar_url name=author.name size="xl" %} | ||
| {% include "v3/includes/_avatar_v3.html" with src=author.avatar_url name=author.name size="xl" only %} | ||
| {% endif %} | ||
|
|
||
| <div class="user-profile__content"> | ||
|
|
||
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.
Just a thought – looking at this I feel like we should probably eventually have a card heading component to handle these heading level mapping and use it in other cards as well. Thanks for this update!
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.
Great minds think alike, I commented the same on the other comment chain.
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.
Ooops sorry I missed that, I'm glad we're on the same page 😆🙌. This should be used in other cards as well