mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-18 22:39:44 +00:00
Convert hook to basePage
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import './newPage.less';
|
||||
|
||||
// Common imports
|
||||
import React from 'react';
|
||||
import request from '../../utils/request-middleware.js';
|
||||
import _ from 'lodash';
|
||||
import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx';
|
||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||
import React from 'react';
|
||||
import request from '../../utils/request-middleware.js';
|
||||
import _ from 'lodash';
|
||||
import EditorPage from '../basePages/editPage/editorPage.jsx';
|
||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||
|
||||
const NewPage = (props)=>{
|
||||
props = {
|
||||
@@ -26,21 +25,18 @@ const NewPage = (props)=>{
|
||||
window.location = `/edit/${savedBrew.editId}`;
|
||||
};
|
||||
|
||||
const {
|
||||
renderPanels
|
||||
} = useCommonEditPageFunctions({
|
||||
useLocalStorage : true,
|
||||
sandbox : true,
|
||||
showFloatingButtons : false,
|
||||
showEditorButtons : true,
|
||||
pageName : 'newPage',
|
||||
brew : props.brew,
|
||||
userThemes : props.userThemes,
|
||||
save,
|
||||
onSaveSuccess,
|
||||
});
|
||||
|
||||
return renderPanels();
|
||||
return (
|
||||
<EditorPage
|
||||
useLocalStorage = {true}
|
||||
sandbox = {true}
|
||||
showFloatingButtons = {false}
|
||||
showEditorButtons = {true}
|
||||
pageName = {'newPage'}
|
||||
brew = {props.brew}
|
||||
userThemes = {props.userThemes}
|
||||
save = {save}
|
||||
onSaveSuccess = {onSaveSuccess}
|
||||
></EditorPage>);
|
||||
};
|
||||
|
||||
export default NewPage;
|
||||
|
||||
Reference in New Issue
Block a user