From f12718c25b6a4c007d9dd42e241f8ce2b8f83e35 Mon Sep 17 00:00:00 2001 From: Karishma Chadha <kchadha@scratch.mit.edu> Date: Fri, 20 Apr 2018 17:34:28 -0400 Subject: [PATCH] Toggle upload button title based on whether the currently selected sprite is the stage or not. --- src/containers/costume-tab.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx index 50a38844c..425fe144f 100644 --- a/src/containers/costume-tab.jsx +++ b/src/containers/costume-tab.jsx @@ -48,9 +48,14 @@ const messages = defineMessages({ description: 'Button to add a surprise costume in the editor tab', id: 'gui.costumeTab.addSurpriseCostume' }, + addFileBackdropMsg: { + defaultMessage: 'Upload Backdrop', + description: 'Button to add a backdrop by uploading a file in the editor tab', + id: 'gui.costumeTab.addFileBackdrop' + }, addFileCostumeMsg: { defaultMessage: 'Upload Costume', - description: 'Button to add a file upload costume in the editor tab', + description: 'Button to add a costume by uploading a file in the editor tab', id: 'gui.costumeTab.addFileCostume' }, addCameraCostumeMsg: { @@ -240,6 +245,7 @@ class CostumeTab extends React.Component { } const addLibraryMessage = target.isStage ? messages.addLibraryBackdropMsg : messages.addLibraryCostumeMsg; + const addFileMessage = target.isStage ? messages.addFileBackdropMsg : messages.addFileCostumeMsg; const addSurpriseFunc = target.isStage ? this.handleSurpriseBackdrop : this.handleSurpriseCostume; const addLibraryFunc = target.isStage ? onNewLibraryBackdropClick : onNewLibraryCostumeClick; const addLibraryIcon = target.isStage ? addLibraryBackdropIcon : addLibraryCostumeIcon; @@ -263,7 +269,7 @@ class CostumeTab extends React.Component { img: cameraIcon }, { - title: intl.formatMessage(messages.addFileCostumeMsg), + title: intl.formatMessage(addFileMessage), img: fileUploadIcon, onClick: this.handleFileUploadClick, fileAccept: '.svg,', // .png, .jpg, .jpeg coming soon -- GitLab