0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 23:42:44 +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 PPR_THRESHOLD = 50;
const BrewPage = createClass({
displayName : `BrewPage`,
getDefaultProps : function() {
return {
contents : '',
index : 0
};
},
render : function() {
return <div className='page' id={`p${this.props.index + 1}`} >
<div className='columnWrapper' dangerouslySetInnerHTML={{ __html: this.props.contents }} />
</div>;
}
});
const BrewPage = (props)=>{
props = {
contents : '',
index : 0,
...props
};
return <div className='page' id={`p${props.index + 1}`} >
<div className='columnWrapper' dangerouslySetInnerHTML={{ __html: props.contents }} />
</div>;
};
const BrewRenderer = createClass({
displayName : 'BrewRenderer',