-
Notifications
You must be signed in to change notification settings - Fork 2
feature: add new bool property withClasses that add classes to rows #6
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
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.
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.