mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 05:22:40 +00:00
Simplify "BrewPage" into Functional Component
This commit is contained in:
@@ -19,20 +19,16 @@ const Themes = require('themes/themes.json');
|
|||||||
const PAGE_HEIGHT = 1056;
|
const PAGE_HEIGHT = 1056;
|
||||||
const PPR_THRESHOLD = 50;
|
const PPR_THRESHOLD = 50;
|
||||||
|
|
||||||
const BrewPage = createClass({
|
const BrewPage = (props)=>{
|
||||||
displayName : `BrewPage`,
|
props = {
|
||||||
getDefaultProps : function() {
|
contents : '',
|
||||||
return {
|
index : 0,
|
||||||
contents : '',
|
...props
|
||||||
index : 0
|
};
|
||||||
};
|
return <div className='page' id={`p${props.index + 1}`} >
|
||||||
},
|
<div className='columnWrapper' dangerouslySetInnerHTML={{ __html: props.contents }} />
|
||||||
render : function() {
|
</div>;
|
||||||
return <div className='page' id={`p${this.props.index + 1}`} >
|
};
|
||||||
<div className='columnWrapper' dangerouslySetInnerHTML={{ __html: this.props.contents }} />
|
|
||||||
</div>;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const BrewRenderer = createClass({
|
const BrewRenderer = createClass({
|
||||||
displayName : 'BrewRenderer',
|
displayName : 'BrewRenderer',
|
||||||
|
|||||||
Reference in New Issue
Block a user