Skip to content
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

feat(components/molecule/avatar): handle background color for avatar #2337

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

tonyghiani
Copy link
Contributor

molecule/avatar

πŸ” Show

Types of changes

  • πŸͺ² Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • πŸ’₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🧾 Documentation
  • πŸ“· Demo
  • πŸ§ͺ Test
  • 🧠 Refactor
  • πŸ’„ Styles

Description, Motivation and Context

When a passed src image was erroring and the name property was passed, the background-color for the fallback was not applied correctly.

@github-actions
Copy link

STATEMENTS BRANCHES FUNCTIONS LINES
≍ ≍ 0= ≍ 0.07↓ ≍ 0= ≍ 0=
% 72.02 57.61 58.85 73.69
ABS 2603 / 3614 1461 / 2536 472 / 802 2510 / 3406

@@ -192,7 +192,7 @@ describe(json.name, () => {
const {getByText} = setup(props)

// Then
expect(getByText('JS')).to.be.visible
expect(getByText('js')).to.be.visible
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool initials πŸ˜‰

so the test is no longer should render fallback name initials uppercase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is I've changed the way initials are "uppercased", using the CSS transform property instead of the .toUpperCase() js method. The final visual result is the same :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh gotcha!

@tonyghiani tonyghiani merged commit 055e7d3 into master Sep 29, 2022
@tonyghiani tonyghiani deleted the bugfix/avatar-background-color branch September 29, 2022 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants