From 14b9c17ebf6aba7083c432e72b4043bbc49e37be Mon Sep 17 00:00:00 2001
From: Ben Wheeler <wheeler.benjamin@gmail.com>
Date: Mon, 8 Oct 2018 12:49:59 -0400
Subject: [PATCH] renamed doStoreProject; moved menubar z-index positioning to
 gui

---
 src/components/gui/gui.css           |  6 ++++++
 src/components/gui/gui.jsx           |  4 +---
 src/components/menu-bar/menu-bar.css |  2 --
 src/components/menu-bar/menu-bar.jsx | 12 ++++++------
 src/lib/project-saver-hoc.jsx        |  9 ++++-----
 5 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/components/gui/gui.css b/src/components/gui/gui.css
index 16f79ea4d..a10b08b60 100644
--- a/src/components/gui/gui.css
+++ b/src/components/gui/gui.css
@@ -279,6 +279,12 @@ $fade-out-distance: 15px;
     margin-top: 0;
 }
 
+/* Menu */
+
+.menu-bar-position {
+    position: relative;
+    z-index: $z-index-menu-bar;
+}
 /* Alerts */
 
 .alerts-container {
diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx
index 60021add0..ac22df9c8 100644
--- a/src/components/gui/gui.jsx
+++ b/src/components/gui/gui.jsx
@@ -64,7 +64,6 @@ const GUIComponent = props => {
         children,
         costumeLibraryVisible,
         costumesTabVisible,
-        doStoreProject,
         enableCommunity,
         importInfoVisible,
         intl,
@@ -166,7 +165,7 @@ const GUIComponent = props => {
                 ) : null}
                 <MenuBar
                     accountNavOpen={accountNavOpen}
-                    doStoreProject={doStoreProject}
+                    className={styles.menuBarPosition}
                     enableCommunity={enableCommunity}
                     renderLogin={renderLogin}
                     userOwnsProject={userOwnsProject}
@@ -312,7 +311,6 @@ GUIComponent.propTypes = {
     children: PropTypes.node,
     costumeLibraryVisible: PropTypes.bool,
     costumesTabVisible: PropTypes.bool,
-    doStoreProject: PropTypes.func,
     enableCommunity: PropTypes.bool,
     importInfoVisible: PropTypes.bool,
     intl: intlShape.isRequired,
diff --git a/src/components/menu-bar/menu-bar.css b/src/components/menu-bar/menu-bar.css
index 2fa801058..dcc230672 100644
--- a/src/components/menu-bar/menu-bar.css
+++ b/src/components/menu-bar/menu-bar.css
@@ -3,7 +3,6 @@
 @import "../../css/z-index.css";
 
 .menu-bar {
-    position: relative;
     display: flex;
     flex-direction: row;
     justify-content: space-between;
@@ -30,7 +29,6 @@
     font-weight: bold;
     background-color: $motion-primary;
     color: $ui-white;
-    z-index: $z-index-menu-bar;
 }
 
 .main-menu {
diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx
index bcf0abc10..3c64daa37 100644
--- a/src/components/menu-bar/menu-bar.jsx
+++ b/src/components/menu-bar/menu-bar.jsx
@@ -236,9 +236,11 @@ class MenuBar extends React.Component {
         );
         return (
             <Box
-                className={classNames(styles.menuBar, {
-                    [styles.saveInProgress]: this.state.projectSaveInProgress
-                })}
+                className={classNames(
+                    this.props.className,
+                    styles.menuBar,
+                    {[styles.saveInProgress]: this.state.projectSaveInProgress}
+                )}
             >
                 <div className={styles.mainMenu}>
                     <div className={styles.fileGroup}>
@@ -288,8 +290,6 @@ class MenuBar extends React.Component {
                                 place={this.props.isRtl ? 'left' : 'right'}
                                 onRequestClose={this.props.onRequestCloseFile}
                             >
-                                {/* note that it does not matter whether user is logged in or not, or
-                                gui player is embedded or standalone */}
                                 <MenuItem
                                     isRtl={this.props.isRtl}
                                     onClick={this.handleClickNew}
@@ -617,7 +617,7 @@ class MenuBar extends React.Component {
 
 MenuBar.propTypes = {
     accountMenuOpen: PropTypes.bool,
-    doStoreProject: PropTypes.func,
+    className: PropTypes.string,
     editMenuOpen: PropTypes.bool,
     enableCommunity: PropTypes.bool,
     fileMenuOpen: PropTypes.bool,
diff --git a/src/lib/project-saver-hoc.jsx b/src/lib/project-saver-hoc.jsx
index e64666ed7..867428d9c 100644
--- a/src/lib/project-saver-hoc.jsx
+++ b/src/lib/project-saver-hoc.jsx
@@ -20,14 +20,14 @@ const ProjectSaverHOC = function (WrappedComponent) {
         constructor (props) {
             super(props);
             bindAll(this, [
-                'doStoreProject'
+                'storeProject' // NOTE: do i need to bind this?
             ]);
             this.state = {
             };
         }
         componentWillReceiveProps (nextProps) {
             if (nextProps.isSavingWithId && !this.props.isSavingWithId) {
-                this.doStoreProject({
+                this.storeProject({
                     action: 'update',
                     id: nextProps.reduxProjectId
                 })
@@ -41,7 +41,7 @@ const ProjectSaverHOC = function (WrappedComponent) {
                     });
             }
             if (nextProps.isCreatingNew && !this.props.isCreatingNew) {
-                this.doStoreProject({
+                this.storeProject({
                     action: 'create'
                 })
                     .then(response => {
@@ -53,7 +53,7 @@ const ProjectSaverHOC = function (WrappedComponent) {
                     });
             }
         }
-        doStoreProject (opts) {
+        storeProject (opts) {
             return this.props.vm.saveProjectSb3()
                 .then(content => {
                     const assetType = storage.AssetType.Project;
@@ -85,7 +85,6 @@ const ProjectSaverHOC = function (WrappedComponent) {
             } = this.props;
             return (
                 <WrappedComponent
-                    doStoreProject={this.doStoreProject}
                     {...componentProps}
                 />
             );
-- 
GitLab