Allow icons to be changed by the user#74
Conversation
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
==========================================
- Coverage 95.54% 95.16% -0.38%
==========================================
Files 60 60
Lines 718 745 +27
Branches 171 175 +4
==========================================
+ Hits 686 709 +23
- Misses 21 25 +4
Partials 11 11
Continue to review full report at Codecov.
|
| updateFilter={this.updateFilter} | ||
| searchKey="first_name" | ||
| itemOnClick={action('clicked on')} | ||
| icons={FontAwesomeIcons(5)} |
There was a problem hiding this comment.
is this supposed to be inconsistent with the other place? FontAwesome(4) vs FontAwesomeIcons(5)
There was a problem hiding this comment.
Sorry, forgot to update this after adding the index file
| Pagination: DefaultPagination, | ||
| ErrorMessage: DefaultErrorMessage, | ||
| data: [], | ||
| icons: {}, |
There was a problem hiding this comment.
since the css file that we publish with the js already has FA included, I do think we should have some defaults set up to work out of the box.
There was a problem hiding this comment.
Not any more 😈
https://github.com/uptick/react-object-list/pull/74/files#diff-5fea21b08a353ec25a50a2178f880439L1
Default is currently no icons so that there is no dependency, but we could revert that, thoughts @scaredcat @jarekwg ?
There was a problem hiding this comment.
Yep I like it. As long as there are still icons in the demo, we're good.
Maybes also adjust the main README to explain how this package treats icons now (import your own, feed them into the props)
| span.style.display = 'none' | ||
| document.body.insertBefore(span, document.body.firstChild) | ||
|
|
||
| const css = (element, property) => window.getComputedStyle(element, null).getPropertyValue(property) |
01a658d to
7fe53aa
Compare
Remove dependency on font awesome 4 by allowing users to specify their own icons using the icons prop. This overrides only those specified.
i.e.
Defaults added for FA4 FA5, use:
This will check if the required version of font awesome is loaded in the DOM and warn if not.
Either way it'll apply the icons you picked (so as not to cause problems for false negatives)