diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index 872950a211c1bd3e229651930659e9dcbe39af75..ad02b2feda7d185e3cd468347363b93a77e58ac7 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -48,6 +48,7 @@ const GUIComponent = props => { cardsVisible, children, costumesTabVisible, + enableCommunity, importInfoVisible, intl, isPlayerOnly, @@ -108,7 +109,7 @@ const GUIComponent = props => { {cardsVisible ? ( <Cards /> ) : null} - <MenuBar /> + <MenuBar enableCommunity={enableCommunity} /> <Box className={styles.bodyWrapper}> <Box className={styles.flexWrapper}> <Box className={styles.editorWrapper}> @@ -224,6 +225,7 @@ GUIComponent.propTypes = { cardsVisible: PropTypes.bool, children: PropTypes.node, costumesTabVisible: PropTypes.bool, + enableCommunity: PropTypes.bool, importInfoVisible: PropTypes.bool, intl: intlShape.isRequired, isPlayerOnly: PropTypes.bool, diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx index 8a5fb5bb7dd099f35b5ee83ad0309242a62be961..7742e210e362ac0d1772e98c447cb792ecec8a46 100644 --- a/src/components/menu-bar/menu-bar.jsx +++ b/src/components/menu-bar/menu-bar.jsx @@ -15,6 +15,7 @@ import {MenuItem, MenuSection} from '../menu/menu.jsx'; import ProjectSaver from '../../containers/project-saver.jsx'; import {openTipsLibrary} from '../../reducers/modals'; +import {setPlayer} from '../../reducers/mode'; import { openFileMenu, closeFileMenu, @@ -263,19 +264,33 @@ const MenuBar = props => ( </MenuBarItemTooltip> </div> <div className={classNames(styles.menuBarItem, styles.communityButtonWrapper)}> - <MenuBarItemTooltip id="community-button"> + {props.enableCommunity ? <Button className={classNames(styles.communityButton)} iconClassName={styles.communityButtonIcon} iconSrc={communityIcon} + onClick={props.onSeeCommunity} > <FormattedMessage defaultMessage="See Community" description="Label for see community button" id="gui.menuBar.seeCommunity" /> - </Button> - </MenuBarItemTooltip> + </Button> : + <MenuBarItemTooltip id="community-button"> + <Button + className={classNames(styles.communityButton)} + iconClassName={styles.communityButtonIcon} + iconSrc={communityIcon} + > + <FormattedMessage + defaultMessage="See Community" + description="Label for see community button" + id="gui.menuBar.seeCommunity" + /> + </Button> + </MenuBarItemTooltip> + } </div> </div> <div className={classNames(styles.menuBarItem, styles.feedbackButtonWrapper)}> @@ -352,12 +367,14 @@ const MenuBar = props => ( MenuBar.propTypes = { editMenuOpen: PropTypes.bool, + enableCommunity: PropTypes.bool, fileMenuOpen: PropTypes.bool, onClickEdit: PropTypes.func, onClickFile: PropTypes.func, onOpenTipLibrary: PropTypes.func, onRequestCloseEdit: PropTypes.func, - onRequestCloseFile: PropTypes.func + onRequestCloseFile: PropTypes.func, + onSeeCommunity: PropTypes.func }; const mapStateToProps = state => ({ @@ -370,7 +387,8 @@ const mapDispatchToProps = dispatch => ({ onClickFile: () => dispatch(openFileMenu()), onRequestCloseFile: () => dispatch(closeFileMenu()), onClickEdit: () => dispatch(openEditMenu()), - onRequestCloseEdit: () => dispatch(closeEditMenu()) + onRequestCloseEdit: () => dispatch(closeEditMenu()), + onSeeCommunity: () => dispatch(setPlayer(true)) }); export default connect( diff --git a/src/containers/gui.jsx b/src/containers/gui.jsx index 705ccf93c49da6e867583b9a86e62d873275b0d6..c8d48a451b85f65472e76b6e60a60411b3dec43d 100644 --- a/src/containers/gui.jsx +++ b/src/containers/gui.jsx @@ -13,7 +13,6 @@ import { COSTUMES_TAB_INDEX, SOUNDS_TAB_INDEX } from '../reducers/editor-tab'; -import {setPlayer} from '../reducers/mode'; import ProjectLoaderHOC from '../lib/project-loader-hoc.jsx'; import vmListenerHOC from '../lib/vm-listener-hoc.jsx'; @@ -120,8 +119,7 @@ const mapDispatchToProps = dispatch => ({ onExtensionButtonClick: () => dispatch(openExtensionLibrary()), onActivateTab: tab => dispatch(activateTab(tab)), onActivateCostumesTab: () => dispatch(activateTab(COSTUMES_TAB_INDEX)), - onActivateSoundsTab: () => dispatch(activateTab(SOUNDS_TAB_INDEX)), - onSetPlayerMode: player => dispatch(setPlayer(player)) + onActivateSoundsTab: () => dispatch(activateTab(SOUNDS_TAB_INDEX)) }); const ConnectedGUI = connect(