diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index dfcc7d8dd..f8311e254 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -66,8 +66,10 @@ const GUIComponent = props => { backpackVisible, blocksTabVisible, cardsVisible, + canChangeLanguage, canCreateNew, canEditTitle, + canManageFiles, canRemix, canSave, canCreateCopy, @@ -202,9 +204,11 @@ const GUIComponent = props => { authorId={authorId} authorThumbnailUrl={authorThumbnailUrl} authorUsername={authorUsername} + canChangeLanguage={canChangeLanguage} canCreateCopy={canCreateCopy} canCreateNew={canCreateNew} canEditTitle={canEditTitle} + canManageFiles={canManageFiles} canRemix={canRemix} canSave={canSave} canShare={canShare} @@ -359,9 +363,11 @@ GUIComponent.propTypes = { backpackVisible: PropTypes.bool, basePath: PropTypes.string, blocksTabVisible: PropTypes.bool, + canChangeLanguage: PropTypes.bool, canCreateCopy: PropTypes.bool, canCreateNew: PropTypes.bool, canEditTitle: PropTypes.bool, + canManageFiles: PropTypes.bool, canRemix: PropTypes.bool, canSave: PropTypes.bool, canShare: PropTypes.bool, @@ -411,8 +417,10 @@ GUIComponent.defaultProps = { backpackHost: null, backpackVisible: false, basePath: './', + canChangeLanguage: true, canCreateNew: false, canEditTitle: false, + canManageFiles: true, canRemix: false, canSave: false, canCreateCopy: false, diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx index 6105a60e5..d4a5393e0 100644 --- a/src/components/menu-bar/menu-bar.jsx +++ b/src/components/menu-bar/menu-bar.jsx @@ -331,7 +331,7 @@ class MenuBar extends React.Component { onClick={this.props.onClickLogo} /> -
@@ -345,82 +345,86 @@ class MenuBar extends React.Component { />
-
-
- - )} + {(this.props.canManageFiles) && ( +
- - - {newProjectMessage} - - - {(this.props.canSave || this.props.canCreateCopy || this.props.canRemix) && ( + + - {this.props.canSave ? ( - - {saveNowMessage} - - ) : []} - {this.props.canCreateCopy ? ( - - {createCopyMessage} - - ) : []} - {this.props.canRemix ? ( - - {remixMessage} - - ) : []} + + {newProjectMessage} + - )} - - - {(className, renderFileInput, loadProject) => ( + {(this.props.canSave || this.props.canCreateCopy || this.props.canRemix) && ( + + {this.props.canSave ? ( + + {saveNowMessage} + + ) : []} + {this.props.canCreateCopy ? ( + + {createCopyMessage} + + ) : []} + {this.props.canRemix ? ( + + {remixMessage} + + ) : []} + + )} + + + {(className, renderFileInput, loadProject) => ( + + {/* eslint-disable max-len */} + {this.props.intl.formatMessage(sharedMessages.loadFromComputerTitle)} + {/* eslint-enable max-len */} + {renderFileInput()} + + )} + + {(className, downloadProjectCallback) => ( - {this.props.intl.formatMessage(sharedMessages.loadFromComputerTitle)} - {renderFileInput()} + - )} - - {(className, downloadProjectCallback) => ( - - - - )} - - -
+ )} + +
+
+ )}