-
Notifications
You must be signed in to change notification settings - Fork 227
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
fix(card): add missing hasRipple (#248) #255
Conversation
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 curious what the use case for not having the ripple is?
packages/card/PrimaryContent.js
Outdated
); | ||
} | ||
} | ||
|
||
|
||
const PrimaryContentDefault = (props) => { |
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.
Instead of PrimaryContentDefault, can we name it PrimaryContentBase?
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.
No problem. That should probably be renamed as well in material-icon:
Good question. Looking mdc-card it looks like there is no use-case for PrimaryContent without ripple:
I can refactor this PR to remove |
@bmihelac that sounds good to me! |
@moog16 PR has been refactored (would rebase when add tests) One thing that I am not sure how to do is testing that PrimaryContent has ripple. Here is my not working code: material-components-web-react/test/unit/card/Content.test.js Lines 15 to 21 in 728a0ee
Any idea how to test this? |
@bmihelac figured it out...the upgraded class is added in a requestAnimationFrame. So just wrap the assert in a requestAnimationFrame. |
@bmihelac - instead of wrapping it in a rAF, please use the rAF helper we have https://github.com/material-components/material-components-web-react/blob/master/test/unit/helpers/raf.js. Example seen in ripple unit test. |
Thanks @moog16, that worked perfectly. |
Let me know if anything else is needed regarding this. |
looks good to me. I'm going to open another pr for tests. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #255 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 27 27
Lines 1089 1089
Branches 107 107
=======================================
Hits 1063 1063
Misses 26 26
Continue to review full report at Codecov.
|
signed. |
thank you @moog16 ! |
No description provided.