-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(searchbox): Make the searchBox BEMish
I've also updated the `poweredBy` as well. I've changed the logic of adding inline `style` to using a specific class (defined in the default `css` file). I've switched the display/hide logic. We no longer need to define a `display=true` in the props to show it, but a `hidden=true` to hide it instead. BREAKING CHANGE: The `searchBox` widget now expect a `cssClasses.{input, poweredBy}`
- Loading branch information
1 parent
da1bf86
commit db8bd60
Showing
6 changed files
with
92 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var React = require('react'); | ||
var bem = require('../../lib/utils').bemHelper('ais-powered-by'); | ||
var cx = require('classnames'); | ||
var logo = require('url?limit=10000!./algolia_logo.png'); | ||
|
||
require('style?prepend!raw!./powered-by.css'); | ||
|
||
class PoweredBy extends React.Component { | ||
render() { | ||
var cssClasses = { | ||
root: cx(this.props.className, bem(null)), | ||
link: bem('link'), | ||
image: bem('image') | ||
}; | ||
|
||
return ( | ||
<div className={cssClasses.root}> | ||
Powered by | ||
<a className={cssClasses.link} href="https://www.algolia.com/"> | ||
<img className={cssClasses.image} src={logo} /> | ||
</a> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
PoweredBy.propTypes = { | ||
className: React.PropTypes.string | ||
}; | ||
|
||
module.exports = PoweredBy; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.ais-powered-by { | ||
font-size: 0.8em; | ||
text-align: right; | ||
} | ||
.ais-powered-by--image { | ||
height: 16px; | ||
margin-bottom: 2px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters