mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 17:52:47 +00:00
Change functions to const vars
This commit is contained in:
@@ -41,7 +41,7 @@ const HomePage =(props)=>{
|
|||||||
fetchThemeBundle(this, this.props.brew.renderer, this.props.brew.theme);
|
fetchThemeBundle(this, this.props.brew.renderer, this.props.brew.theme);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSave : function(){
|
const handleSave ()=>{
|
||||||
request.post('/api')
|
request.post('/api')
|
||||||
.send(this.state.brew)
|
.send(this.state.brew)
|
||||||
.end((err, res)=>{
|
.end((err, res)=>{
|
||||||
@@ -52,29 +52,31 @@ const HomePage =(props)=>{
|
|||||||
const brew = res.body;
|
const brew = res.body;
|
||||||
window.location = `/edit/${brew.editId}`;
|
window.location = `/edit/${brew.editId}`;
|
||||||
});
|
});
|
||||||
},
|
};
|
||||||
handleSplitMove : function(){
|
|
||||||
|
const handleSplitMove ()=>{
|
||||||
this.editor.current.update();
|
this.editor.current.update();
|
||||||
},
|
};
|
||||||
|
|
||||||
handleEditorViewPageChange : function(pageNumber){
|
const handleEditorViewPageChange (pageNumber)=>{
|
||||||
this.setState({ currentEditorViewPageNum: pageNumber });
|
this.setState({ currentEditorViewPageNum: pageNumber });
|
||||||
},
|
};
|
||||||
|
|
||||||
handleEditorCursorPageChange : function(pageNumber){
|
const handleEditorCursorPageChange (pageNumber)=>{
|
||||||
this.setState({ currentEditorCursorPageNum: pageNumber });
|
this.setState({ currentEditorCursorPageNum: pageNumber });
|
||||||
},
|
};
|
||||||
|
|
||||||
handleBrewRendererPageChange : function(pageNumber){
|
const handleBrewRendererPageChange (pageNumber)=>{
|
||||||
this.setState({ currentBrewRendererPageNum: pageNumber });
|
this.setState({ currentBrewRendererPageNum: pageNumber });
|
||||||
},
|
};
|
||||||
|
|
||||||
handleTextChange : function(text){
|
const handleTextChange (text)=>{
|
||||||
this.setState((prevState)=>({
|
this.setState((prevState)=>({
|
||||||
brew : { ...prevState.brew, text: text },
|
brew : { ...prevState.brew, text: text },
|
||||||
}));
|
}));
|
||||||
},
|
};
|
||||||
renderNavbar : function(){
|
|
||||||
|
const renderNavbar = ()=>{
|
||||||
return <Navbar ver={this.props.ver}>
|
return <Navbar ver={this.props.ver}>
|
||||||
<Nav.section>
|
<Nav.section>
|
||||||
{this.state.error ?
|
{this.state.error ?
|
||||||
@@ -88,12 +90,12 @@ const HomePage =(props)=>{
|
|||||||
<AccountNavItem />
|
<AccountNavItem />
|
||||||
</Nav.section>
|
</Nav.section>
|
||||||
</Navbar>;
|
</Navbar>;
|
||||||
},
|
};
|
||||||
|
|
||||||
render : function(){
|
return (
|
||||||
return <div className='homePage sitePage'>
|
<div className='homePage sitePage'>
|
||||||
<Meta name='google-site-verification' content='NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4' />
|
<Meta name='google-site-verification' content='NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4' />
|
||||||
{this.renderNavbar()}
|
{renderNavbar()}
|
||||||
<div className='content'>
|
<div className='content'>
|
||||||
<SplitPane onDragFinish={this.handleSplitMove}>
|
<SplitPane onDragFinish={this.handleSplitMove}>
|
||||||
<Editor
|
<Editor
|
||||||
@@ -128,8 +130,8 @@ const HomePage =(props)=>{
|
|||||||
<a href='/new' className='floatingNewButton'>
|
<a href='/new' className='floatingNewButton'>
|
||||||
Create your own <i className='fas fa-magic' />
|
Create your own <i className='fas fa-magic' />
|
||||||
</a>
|
</a>
|
||||||
</div>;
|
</div>
|
||||||
}
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = HomePage;
|
module.exports = HomePage;
|
||||||
|
|||||||
Reference in New Issue
Block a user