-
Notifications
You must be signed in to change notification settings - Fork 2
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
[DSS-157] Avatar - Custom Icon and Color #1605
Conversation
e7799b7
to
f1cf205
Compare
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 great!
Not blocking, but what do you think about restructuring so that rather than badge
, badgeColor
, and badgeIcon
we just have badge
but it can accept just true
(for default badge) or a hash/object with optional icon
and color
properties for encapsulating the custom settings?
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 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.
👍 LGTM, with one note for the badge appearance:
Requirements for the issue are unclear on this, but the Figma mocks are displaying various social media logo badges with varying background color fills.
The issue that @pixelflips is seeing is because the icon examples in Rails are using -filled
variants. If the intent will be to allow the badge_color
to affect the background, then we'll have to ask Design to add those versions of the icons as well. Otherwise, it's working as intended.
@pixelflips @monkeypox8 Thanks for the feedback here. I just spoke to Quinton about this issue and yes, it looks like this is going to have to be brought up to design. Filled icons are working as intended, but those with only strokes are going to look awkward. Going to bring this up in the team sync for ideas. |
Per feedback from the team and design, I'll be implementing a solution for both a foreground (icon stroke/fill) and background color. |
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.
Code looks great, but I am seeing an issue with Storybook. When setting Badge to true
and then trying to add a string
for the badgeBackgroundColor
the screen goes blank and an error shows in the console.
Screen.Recording.2022-10-12.at.9.02.01.AM.mov
Yeah @pixelflips this is a weird issue, and I think it's Storybook related, but can't confirm entirely. If you set the background color first and then set badge to true, then it works as inspected. |
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.
@anechol it is weird for sure, maybe @ju-Skinner or @philschanely have thoughts on the error I mentioned above. 🤞🏼 |
Haven't had a chance to dig into it, but best I can tell is that the |
@monkeypox8 Thanks for the pointer. I adjusted the conditional so this should work fine in storybook now. |
Ahh thanks for pointing this out @pixelflips . I might have to look into this further as I'm not sure what's a good solution to handle every use case for every icon in the library 🤔 |
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.
👍 LGTM! Left a note on one cleanup item to consider.
<div className="sage-avatar__badge"> | ||
<div | ||
className={badgeClassnames} | ||
style={({ |
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.
(non-blocking) You can also drop the enclosing parentheses ()
here now that the conditional has been removed.
Agreed; this is going to be pretty difficult to solve without a change to our icon system sizing, so I'm inclined to suggest we leave it for another day if the group's on board. Right now the use case for custom badges is limited. But if it does become an issue, we could always apply a 90% scale transform or something similar, though it'd have to be across the board. |
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 job. Thanks for adding specs.
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.
👍 👍
Description
Adds props to allow for background and foreground (icon stroke/fill) color for badges. Attempting to provide a backwards compatible solution to not disturb what's already been used in
kp
.Screenshots
Screen.Recording.2022-10-14.at.10.21.02.AM.mov
Testing in
sage-lib
Rails
Testing in
kajabi-products
(LOW) Adds props to allow for background and foreground (icon stroke/fill) color for badges.
Related
DSS-157