From 963ec282d3b1054293d18dd6da24fe8c0955e379 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 29 Mar 2024 20:06:16 +1300 Subject: [PATCH] Initial functionality pass --- client/homebrew/pages/editPage/editPage.jsx | 49 +++++++++++-------- .../lockNotification/lockNotification.jsx | 22 +++++++++ .../lockNotification/lockNotification.less | 17 +++++++ 3 files changed, 67 insertions(+), 21 deletions(-) create mode 100644 client/homebrew/pages/editPage/lockNotification/lockNotification.jsx create mode 100644 client/homebrew/pages/editPage/lockNotification/lockNotification.less diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index d5af310b5..a18c7f1e9 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -20,6 +20,8 @@ const SplitPane = require('naturalcrit/splitPane/splitPane.jsx'); const Editor = require('../../editor/editor.jsx'); const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx'); +const LockNotification = require('./lockNotification/lockNotification.jsx'); + const Markdown = require('naturalcrit/markdown.js'); const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js'); @@ -51,7 +53,8 @@ const EditPage = createClass({ autoSave : true, autoSaveWarning : false, unsavedTime : new Date(), - currentEditorPage : 0 + currentEditorPage : 0, + displayLockMessage : this.props.brew.lock || false }; }, savedBrew : null, @@ -390,26 +393,30 @@ const EditPage = createClass({ {this.renderNavbar()}
- - - - + {this.state.displayLockMessage ? + this.setState({ displayLockMessage: false })}/> + : + + + + + }
; } diff --git a/client/homebrew/pages/editPage/lockNotification/lockNotification.jsx b/client/homebrew/pages/editPage/lockNotification/lockNotification.jsx new file mode 100644 index 000000000..73617e932 --- /dev/null +++ b/client/homebrew/pages/editPage/lockNotification/lockNotification.jsx @@ -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
+

BREW LOCKED

+

{this.props.message || 'Unable to retrieve Lock Message'}

+ +
; + } +}); + +module.exports = LockNotification; diff --git a/client/homebrew/pages/editPage/lockNotification/lockNotification.less b/client/homebrew/pages/editPage/lockNotification/lockNotification.less new file mode 100644 index 000000000..dac15f063 --- /dev/null +++ b/client/homebrew/pages/editPage/lockNotification/lockNotification.less @@ -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; + } + } +} \ No newline at end of file