From 9e69478923b840b1c0cae0dd53eaeef6794a2a81 Mon Sep 17 00:00:00 2001 From: Paul Kaplan <pkaplan@media.mit.edu> Date: Mon, 30 Apr 2018 14:55:52 -0400 Subject: [PATCH] Show "Backdrops" instead of "Costumes" in tab text if stage is selected. --- src/components/gui/gui.jsx | 20 +++++++++++++++----- src/containers/gui.jsx | 1 + 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index 640e07fdd..5b38ef21e 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -57,6 +57,7 @@ const GUIComponent = props => { onActivateSoundsTab, onActivateTab, previewInfoVisible, + targetIsStage, soundsTabVisible, tipsLibraryVisible, vm, @@ -134,11 +135,19 @@ const GUIComponent = props => { draggable={false} src={costumesIcon} /> - <FormattedMessage - defaultMessage="Costumes" - description="Button to get to the costumes panel" - id="gui.gui.costumesTab" - /> + {targetIsStage ? ( + <FormattedMessage + defaultMessage="Backdrops" + description="Button to get to the backdrops panel" + id="gui.gui.backdropsTab" + /> + ) : ( + <FormattedMessage + defaultMessage="Costumes" + description="Button to get to the costumes panel" + id="gui.gui.costumesTab" + /> + )} </Tab> <Tab className={tabClassNames.tab} @@ -234,6 +243,7 @@ GUIComponent.propTypes = { onTabSelect: PropTypes.func, previewInfoVisible: PropTypes.bool, soundsTabVisible: PropTypes.bool, + targetIsStage: PropTypes.bool, tipsLibraryVisible: PropTypes.bool, vm: PropTypes.instanceOf(VM).isRequired }; diff --git a/src/containers/gui.jsx b/src/containers/gui.jsx index a47467c0c..8d6eb0435 100644 --- a/src/containers/gui.jsx +++ b/src/containers/gui.jsx @@ -101,6 +101,7 @@ const mapStateToProps = state => ({ costumesTabVisible: state.editorTab.activeTabIndex === COSTUMES_TAB_INDEX, loadingStateVisible: state.modals.loadingProject, previewInfoVisible: state.modals.previewInfo, + targetIsStage: state.targets.stage && state.targets.stage.id === state.targets.editingTarget, soundsTabVisible: state.editorTab.activeTabIndex === SOUNDS_TAB_INDEX, tipsLibraryVisible: state.modals.tipsLibrary }); -- GitLab