scratch-www/src/components/banner/banner.jsx
Ray Schamp 7e74c4a105 Use classNames everywhere with dynamic classNames
Fixes GH-141, and keeps it from being introduced on Banner
2015-10-25 12:13:23 -04:00

29 lines
765 B
JavaScript

var classNames = require('classnames');
var React = require('react');
require('./banner.scss');
var Banner = React.createClass({
type: 'Banner',
propTypes: {
onRequestDismiss: React.PropTypes.func
},
render: function () {
var classes = classNames(
'banner',
this.props.className
);
return (
<div className={classes}>
<div className="inner">
{this.props.children}
{this.props.onRequestDismiss ? [
<a className="close" key="close" href="#" onClick={this.props.onRequestDismiss}>x</a>
] : []}
</div>
</div>
);
}
});
module.exports = Banner;