mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
32 lines
838 B
JavaScript
32 lines
838 B
JavaScript
var React = require('react');
|
|
|
|
require('./box.scss');
|
|
|
|
var Box = React.createClass({
|
|
type: 'Box',
|
|
propTypes: {
|
|
title: React.PropTypes.string.isRequired,
|
|
moreTitle: React.PropTypes.string,
|
|
moreHref: React.PropTypes.string
|
|
},
|
|
render: function () {
|
|
return (
|
|
<div className={'box ' + this.props.className}>
|
|
<div className="box-header">
|
|
<h4>{this.props.title}</h4>
|
|
<p>
|
|
<a href={this.props.moreHref}>
|
|
{this.props.moreTitle}
|
|
</a>
|
|
</p>
|
|
</div>
|
|
|
|
<div className="box-content">
|
|
{this.props.children}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
module.exports = Box;
|