Skip to content

Commit 3d6d653

Browse files
Merge pull request #30 from MiroslavDionisiev/UEPR-44
[UEPR-44] exported redux action and added query param showing what tutorial is opened
2 parents eee1a0a + d28a295 commit 3d6d653

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

packages/scratch-gui/src/components/menu-bar/menu-bar.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,12 @@ class MenuBar extends React.Component {
696696
<div className={styles.fileGroup}>
697697
<div
698698
aria-label={this.props.intl.formatMessage(ariaMessages.tutorials)}
699-
className={classNames(styles.menuBarItem, styles.noOffset, styles.hoverable)}
699+
className={classNames(
700+
styles.menuBarItem,
701+
styles.noOffset,
702+
styles.hoverable,
703+
'tutorials-button'
704+
)}
700705
onClick={this.props.onOpenTipLibrary}
701706
>
702707
<img

packages/scratch-gui/src/containers/gui.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class GUI extends React.Component {
6262
// At this time the project view in www doesn't need to know when a project is unloaded
6363
this.props.onProjectLoaded();
6464
}
65+
if (this.props.shouldStopProject && !prevProps.shouldStopProject) {
66+
this.props.vm.stopAll();
67+
}
6568
}
6669
render () {
6770
if (this.props.isError) {
@@ -121,6 +124,7 @@ GUI.propTypes = {
121124
onVmInit: PropTypes.func,
122125
projectHost: PropTypes.string,
123126
projectId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
127+
shouldStopProject: PropTypes.bool,
124128
telemetryModalVisible: PropTypes.bool,
125129
vm: PropTypes.instanceOf(VM).isRequired
126130
};

packages/scratch-gui/src/exported-reducers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {ScratchPaintReducer} from 'scratch-paint';
22
import LocalesReducer, {localesInitialState, initLocale} from './reducers/locales.js';
33
import GuiReducer, {buildInitialState, guiMiddleware, initEmbedded, initFullScreen, initPlayer} from './reducers/gui';
44
import {setFullScreen, setPlayer} from './reducers/mode.js';
5+
import {activateDeck} from './reducers/cards.js';
56

67
export const guiReducers = {
78
locales: LocalesReducer,
@@ -18,5 +19,6 @@ export {
1819
initLocale,
1920
localesInitialState,
2021
setFullScreen,
21-
setPlayer
22+
setPlayer,
23+
activateDeck
2224
};

0 commit comments

Comments
 (0)