mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-04 21:01:32 -05:00
7e74c4a105
Fixes GH-141, and keeps it from being introduced on Banner
29 lines
765 B
JavaScript
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;
|