0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-18 12:12:43 +00:00

Initial functionality pass

This commit is contained in:
G.Ambatte
2024-03-29 20:06:16 +13:00
parent 9f6bc10369
commit 963ec282d3
3 changed files with 67 additions and 21 deletions

View File

@@ -20,6 +20,8 @@ const SplitPane = require('naturalcrit/splitPane/splitPane.jsx');
const Editor = require('../../editor/editor.jsx'); const Editor = require('../../editor/editor.jsx');
const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx'); const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
const LockNotification = require('./lockNotification/lockNotification.jsx');
const Markdown = require('naturalcrit/markdown.js'); const Markdown = require('naturalcrit/markdown.js');
const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js'); const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js');
@@ -51,7 +53,8 @@ const EditPage = createClass({
autoSave : true, autoSave : true,
autoSaveWarning : false, autoSaveWarning : false,
unsavedTime : new Date(), unsavedTime : new Date(),
currentEditorPage : 0 currentEditorPage : 0,
displayLockMessage : this.props.brew.lock || false
}; };
}, },
savedBrew : null, savedBrew : null,
@@ -390,6 +393,9 @@ const EditPage = createClass({
{this.renderNavbar()} {this.renderNavbar()}
<div className='content'> <div className='content'>
{this.state.displayLockMessage ?
<LockNotification message={this.props.brew.lock.message} disableLock={()=>this.setState({ displayLockMessage: false })}/>
:
<SplitPane onDragFinish={this.handleSplitMove} ref='pane'> <SplitPane onDragFinish={this.handleSplitMove} ref='pane'>
<Editor <Editor
ref='editor' ref='editor'
@@ -410,6 +416,7 @@ const EditPage = createClass({
currentEditorPage={this.state.currentEditorPage} currentEditorPage={this.state.currentEditorPage}
/> />
</SplitPane> </SplitPane>
}
</div> </div>
</div>; </div>;
} }

View File

@@ -0,0 +1,22 @@
require('./lockNotification.less');
const React = require('react');
const createClass = require('create-react-class');
const LockNotification = createClass({
displayName : 'LockNotification',
getInitialState : function() {
return {
disableLock : ()=>{}
};
},
render : function(){
return <div className='lockNotification'>
<h1>BREW LOCKED</h1>
<p>{this.props.message || 'Unable to retrieve Lock Message'}</p>
<button onClick={()=>{this.props.disableLock();}}>CLICK TO UNLOCK</button>
</div>;
}
});
module.exports = LockNotification;

View File

@@ -0,0 +1,17 @@
.lockNotification {
background-color: #ccc;
color: black;
padding: 10px;
margin: 25px 100px;
text-align: center;
button {
background-color: #333;
color: white;
margin-top: 10px;
&:hover {
background-color: #777;
}
}
}