mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 10:52:46 +00:00
Setupping up the basic components
This commit is contained in:
32
client/spellsort/sorter/sorter.jsx
Normal file
32
client/spellsort/sorter/sorter.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user