0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-12 13:12:46 +00:00
Files
homebrewery/client/spellsort/sorter/sorter.jsx
2016-05-16 21:23:59 -04:00

33 lines
542 B
JavaScript

var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
var Sorter = React.createClass({
getDefaultProps: function() {
return {
spells : []
};
},
renderSpell : function(spell){
return <div className='spell' key={spell.id}>
{spell.name}
</div>
},
renderSpells : function(){
return _.map(this.props.spells, (spell)=>{
return this.renderSpell(spell)
});
},
render : function(){
return <div className='sorter'>
{this.renderSpells()}
</div>
}
});
module.exports = Sorter;