0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-16 14:42:45 +00:00

Simplify "BrewPage" into Functional Component

This commit is contained in:
Trevor Buckner
2023-11-25 23:23:39 -05:00
parent 045fbbe158
commit 93a7b11017

View File

@@ -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() {
return {
contents : '', contents : '',
index : 0 index : 0,
...props
}; };
}, return <div className='page' id={`p${props.index + 1}`} >
render : function() { <div className='columnWrapper' dangerouslySetInnerHTML={{ __html: props.contents }} />
return <div className='page' id={`p${this.props.index + 1}`} >
<div className='columnWrapper' dangerouslySetInnerHTML={{ __html: this.props.contents }} />
</div>; </div>;
} };
});
const BrewRenderer = createClass({ const BrewRenderer = createClass({
displayName : 'BrewRenderer', displayName : 'BrewRenderer',