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(avatar): adds color prop and test case for it #439

Merged
merged 2 commits into from
Nov 27, 2022

Conversation

yurisldk
Copy link
Collaborator

@yurisldk yurisldk commented Nov 25, 2022

  1. Adds color property to Avatar component to change image ring color. Works only if border property is true.
  2. Adds 'color' test case to the Avatar`s Theme test case

#409

Description

Implements avatar component enhancement introduced by @tiagossa1 The component has ability to change image ring color via prop color if bordered prop is true.

Fixes #409

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

'should use custom colors' case was added to 'Components / Avatar' -> 'Theme' in Avatar.spec.tsx
Storybook story works correct without any updates.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Adds color property to Avatar component to change image ring color. Works only if border property is
true. Adds 'color' test case to the Avatar`s Theme test case

themesberg#409
@codecov
Copy link

codecov bot commented Nov 26, 2022

Codecov Report

Base: 98.43% // Head: 98.56% // Increases project coverage by +0.12% 🎉

Coverage data is based on head (78d4333) compared to base (dadd5b9).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #439      +/-   ##
==========================================
+ Coverage   98.43%   98.56%   +0.12%     
==========================================
  Files         102      102              
  Lines        4288     4307      +19     
  Branches      401      403       +2     
==========================================
+ Hits         4221     4245      +24     
+ Misses         67       62       -5     
Impacted Files Coverage Δ
src/lib/components/Avatar/Avatar.tsx 98.07% <100.00%> (+5.36%) ⬆️
src/lib/theme/default.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Adds 5 examples of rounded and bordered avatars and 5 examples of bordered avatars for Avatar
component

themesberg#409
@rluders
Copy link
Collaborator

rluders commented Nov 27, 2022

@sldk-yuri is it good to review? :)

@yurisldk
Copy link
Collaborator Author

@rluders yes, it's. Take an additional look at default color pallete for avatar component lib/default.ts from line 70 to 80, please. Probably we may change/update it with new colors. Thank you.

@rluders
Copy link
Collaborator

rluders commented Nov 27, 2022

I think this is fine as it is... AFAIK, people still can extend the colors as their like, and add some custom colors to their own theme. Thank you, I'm accepting this PR.

@rluders rluders merged commit 104d6fb into themesberg:main Nov 27, 2022
@yurisldk
Copy link
Collaborator Author

@rluders Thank you.

@yurisldk yurisldk deleted the feat-avatar-component branch November 27, 2022 11:04
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.

Support colors in Avatar component
2 participants