-
Notifications
You must be signed in to change notification settings - Fork 101
feat(user card) - Update User Card to SHINE styles (part 2) #2123
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: beta
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b4ac81d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stacks-svelte ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
giamir
left a comment
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.
Thanks Tavian for the PR. As you can see I am asking for few changes. Hopefully they are all understandable if not let me know and we can pair.
For the svelte component I suggest to create a UserCardAdditionalBling subcomponent so that we don't have to add a lot of logic and props in the existing root UserCard component but just a snippet.
Sidenote
I think AdditionalBling is a pretty poor name to describe the little extra icons that can be added to between the badges and the blings but it is what we have in Figma so I guess we can roll with it. I don't have a better name for now. cc @CGuindon
| &:before { | ||
| height: var(--_ba-before-h); | ||
| margin-top: 0; | ||
| margin-left: calc(var(--su2) * -1); // -2px margin |
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.
We should have --sun2 now after Dan's PR got merged
| color: var(--black-400); | ||
| } | ||
|
|
||
| & &--original-poster { |
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 wonder if this should be named s-user-card--username__op? cc @dancormier
| word-break: break-all; | ||
| } | ||
|
|
||
| & &--awarded-third { |
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.
How are those used? I cannot find them in the docs snippets?
| color: var(--black-400); | ||
| } | ||
|
|
||
| & &--original-poster { |
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.
| import Popover from "../Popover/Popover.svelte"; | ||
| import PopoverReference from "../Popover/PopoverReference.svelte"; | ||
| import PopoverContent from "../Popover/PopoverContent.svelte"; | ||
| import avatarDeleted16 from "../../assets/img/avatar-deleted-16.svg?url"; |
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.
Does this inline the asset otherwise it won't work after things get bundled?
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 think we could probably create an AvatarDeleted16.svelte and an AvatarDeleted24.svelte components in the UserCard folder for now with the svg in it.
| {@render badges()} | ||
| </ul> | ||
| {/if} | ||
| {#if award} |
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 think we would be better off to create UserCardAdditionalBling subcomponent here for consumer to use. We are inferring too much from the value of award (tooltip text, class, etc...). And then just have a additionalBling snippet in the root UserCard component.
|
|
||
| {#snippet userCardMainContent()} | ||
| {@render avatarAndName()} | ||
| {#if recognition && size === "sm"} |
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.
Why do we need recognitionHref?
Can we actually make the UserCardAdditionalBling subcomponent generic so that the consumer can decide if they want to show the "little cup icon" bling or the "recognition icon" bling instead? It would be nice to keep the additions on the UserCard.svelte component to a minimum. As I said in a previous comment maybe just a additionalBling (or additionalBlings) snippet depending if more than one bling can be displayed together or not. Keep things generic and then have any additional logic in the UserCardAdditionalBling subcomponent.
| }, | ||
| { | ||
| "name": "New Contributor", | ||
| "class": "s-user-card--new-contributor", |
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 class does not exist in less, we should probably remove it from the docs and the examples
| <svelte:element | ||
| this={recognitionHref ? "a" : "div"} | ||
| href={recognitionHref} | ||
| class="s-user-card--group s-user-card--recognition" |
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.
The same s-user-card--recognition is used for 2 purposes:
- for the container element "Recognized by..."
- for the recognition icon in the additional blings section
I think this is confusing, we are probably better off create another class for the additional blings part
| </ul> | ||
| {/if} | ||
| {#if award} | ||
| <Popover id="user-card-award-popover" tooltip> |
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.
popover ids need to be unique for the whole page so if we generate them inside svelte we need to either create a random text we can append to them or ask the consumer to do that


SPARK-127
Figma
This PR covers part 2 of the User Card component which includes: