-
Notifications
You must be signed in to change notification settings - Fork 41
components: adds toggle filter component #145
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
components: adds toggle filter component #145
Conversation
|
|
||
| render() { | ||
| return( | ||
| <Overridable id={'ToggleComponent'}> |
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.
Are you sure the overridable id is ok to be the same as the name of the component here ? Also, we will need to pass down the props i.e <Overridable id={'ToggleComponent'}> {...this.props} so they can be available when you override the component I think....
0720535 to
9a6f9bb
Compare
ntarocco
left a comment
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.
LGTM!
Minor: it would be great if you create a new doc page, even empty, only title, so that at some point we document this component too and it is not forgotten!
src/lib/components/Toggle/Toggle.js
Outdated
| } | ||
|
|
||
| _isChecked = (userSelectionFilters) => { | ||
| let isFilterActive = !_isEmpty(userSelectionFilters.filter( |
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.
| let isFilterActive = !_isEmpty(userSelectionFilters.filter( | |
| const isFilterActive = userSelectionFilters.filter(...).length > 0 |
src/lib/components/Toggle/Toggle.js
Outdated
| class ToggleComponent extends Component{ | ||
| constructor(props) { | ||
| super(props); | ||
| this.title = props.title; |
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.
very minor: because of a "bad" habit, we started doing this in the constructor... it is probably not needed, and props can be used directly. Feel free to improve code! :)
9a6f9bb to
53c84e2
Compare
No description provided.