0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-18 12:12:43 +00:00

Moving code between renderer and view

This commit is contained in:
Scott Tolksdorf
2017-03-26 21:19:41 -04:00
parent 74d17f32a5
commit 18d0b68eb0
8 changed files with 190 additions and 96 deletions

View File

@@ -1,6 +1,10 @@
const React = require('react');
const _ = require('lodash');
const cx = require('classnames');
const BrewRenderer = require('homebrewery/brewRenderer/brewRenderer.jsx');
const Markdown = require('homebrewery/markdown.js');
const Headtags = require('vitreum/headtags');
@@ -30,7 +34,7 @@ const PrintPage = React.createClass({
});
}catch(e){}
}
if(this.props.query.dialog) window.print();
//if(this.props.query.dialog) window.print();
},
//TODO: Print page shouldn't replicate functionality in brew renderer
renderStyle : function(){
@@ -58,8 +62,9 @@ const PrintPage = React.createClass({
return <div className='printPage'>
<Headtags.title>{this.state.brew.title}</Headtags.title>
{this.renderPrintInstructions()}
{this.renderStyle()}
{this.renderPages()}
<BrewRenderer text={this.state.brew.text} style={this.state.brew.style} />
</div>
}
});