-
Notifications
You must be signed in to change notification settings - Fork 4
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
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.
|
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.
Looks great. Awesome stuff!
src/ObjectList.demo.stories.js
Outdated
@@ -181,6 +182,7 @@ class InteractiveObjectList extends React.Component { | |||
updateFilter={this.updateFilter} | |||
searchKey="first_name" | |||
itemOnClick={action('clicked on')} | |||
icons={FontAwesomeIcons(5)} |
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.
is this supposed to be inconsistent with the other place? FontAwesome(4)
vs FontAwesomeIcons(5)
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.
Sorry, forgot to update this after adding the index file
@@ -93,6 +103,7 @@ class ObjectList extends Component { | |||
Pagination: DefaultPagination, | |||
ErrorMessage: DefaultErrorMessage, | |||
data: [], | |||
icons: {}, |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
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.
🆒
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)