Skip to content

Commit

Permalink
fix(poweredBy): Extract its hiding capabilities
Browse files Browse the repository at this point in the history
It must not be the responsability of the PoweredBy component to
show/hide itself. Fix #189
  • Loading branch information
redox committed Oct 9, 2015
1 parent 0352b22 commit f5fa9ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions components/PoweredBy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ require('style?prepend!raw!./index.css');

class PoweredBy extends React.Component {
render() {
var poweredByDisplay = (this.props.display === true) ? 'block' : 'none';

return (
<div
className={bem()}
style={{display: poweredByDisplay}}
>
Powered by
<a href="https://www.algolia.com/">
Expand All @@ -26,7 +23,6 @@ class PoweredBy extends React.Component {
}

PoweredBy.propTypes = {
display: React.PropTypes.bool
};

module.exports = PoweredBy;
2 changes: 1 addition & 1 deletion widgets/search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function searchbox({
var PoweredBy = require('../components/PoweredBy');
var poweredByContainer = document.createElement('div');
input.parentNode.appendChild(poweredByContainer);
React.render(<PoweredBy display />, poweredByContainer);
React.render(<PoweredBy />, poweredByContainer);
}

helper.on('change', function(state) {
Expand Down

0 comments on commit f5fa9ee

Please sign in to comment.