0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-15 08:22:43 +00:00

Homebrew first pass is done

This commit is contained in:
Scott Tolksdorf
2015-12-17 22:15:03 -05:00
parent f968421b5b
commit 1c920e66c0
12 changed files with 589 additions and 241 deletions

View File

@@ -0,0 +1,28 @@
var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
var Markdown = require('marked');
var Phb = React.createClass({
getDefaultProps: function() {
return {
text : ""
};
},
renderPages : function(){
return _.map(this.props.text.split('\page'), (pageText, index) => {
return <div className='phb' dangerouslySetInnerHTML={{__html:Markdown(this.props.text)}} key={index} />
})
},
render : function(){
var self = this;
return <div className="pbhPages">
{this.renderPages()}
</div>;
}
});
module.exports = Phb;