diff --git a/src/components/gui/gui.css b/src/components/gui/gui.css index 16f79ea4d684308cf8a6095bb4246b7966eb87af..a10b08b60a4d34e30ae137cfa4f274ab559fa6ff 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 60021add0eb3f84a40a78abccddb89ca38fceee6..ac22df9c893c3f08e0a703e65edaabde36b2ebc5 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 2fa801058d14e885ffa90d5f9dc0beff5701a668..dcc230672499634335229e1e3295bd626319970a 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 bcf0abc109db9e5c0df717179de6aaabf437735a..3c64daa37863898bf585ab65ab7b5b5c97c343e2 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 e64666ed709b6172d8e78daaa61bc23c91893ef7..867428d9c078e248943b0aca2c929b44fc439908 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} /> );