feature: add new bool property withClasses that add classes to rows#6
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6 +/- ##
==========================================
+ Coverage 97.87% 97.95% +0.08%
==========================================
Files 1 1
Lines 47 49 +2
==========================================
+ Hits 46 48 +2
Misses 1 1
Continue to review full report at Codecov.
|
jorrit
left a comment
There was a problem hiding this comment.
Thanks for your PR, Marianna. Could you take a look at these review comments and address them? Thanks!
tests/index-test.js
Outdated
| ]; | ||
| const keyGetter = r => r.a; | ||
|
|
||
| const withClasses = true; |
There was a problem hiding this comment.
Please move this line into the test function.
src/index.js
Outdated
| }; | ||
|
|
||
| function headerClass(withClasses, key) { | ||
| return withClasses ? { className: `th-${key}` } : {}; |
There was a problem hiding this comment.
I think header-${key} is more descriptive than th-${key}.
| function rowClass(withClasses, key) { | ||
| return withClasses ? { className: `tr-${key}` } : {}; | ||
| } | ||
|
|
There was a problem hiding this comment.
I think row-${key} is more descriptive than row-${key}.
README.md
Outdated
| | | `object` | CSS styles to apply to the parent table tag. | | ||
| | | `function` | Function returning one of the above. The function receives a state object with boolean property narrow indicating if the current presentation is narrow or wide. | | ||
| | `initialNarrow` | `bool` | Initially render the table in narrow mode when rendering serverside. Set to true when you expect the browser to be narrow to prevent rerendering client side. | | ||
| | `withClasses` | `bool` | Add classNames to each rows and headers cells by using keyGetter function. | |
There was a problem hiding this comment.
Please change to 'Add unique class names to each row and header cell, respectively row-KEY and header-KEY.'.
|
@jorrit please see my changes |
|
My apologies for the delay. 0.6.0 has been released with this feature. Thanks for your contribution! |
|
Thank you! |
No description provided.