1
1
import classNames from 'classnames' ;
2
2
import omit from 'lodash.omit' ;
3
3
import PropTypes from 'prop-types' ;
4
- import React from 'react' ;
4
+ import React , { useCallback } from 'react' ;
5
5
import { defineMessages , FormattedMessage , injectIntl , intlShape } from 'react-intl' ;
6
6
import { connect } from 'react-redux' ;
7
7
import MediaQuery from 'react-responsive' ;
@@ -86,6 +86,8 @@ const GUIComponent = props => {
86
86
costumeLibraryVisible,
87
87
costumesTabVisible,
88
88
debugModalVisible,
89
+ onDebugModalClose,
90
+ onTutorialSelect,
89
91
enableCommunity,
90
92
intl,
91
93
isCreating,
@@ -147,6 +149,13 @@ const GUIComponent = props => {
147
149
tabSelected : classNames ( tabStyles . reactTabsTabSelected , styles . isSelected )
148
150
} ;
149
151
152
+ const onCloseDebugModal = useCallback ( ( ) => {
153
+ if ( onDebugModalClose ) {
154
+ onDebugModalClose ( ) ;
155
+ }
156
+ onRequestCloseDebugModal ( ) ;
157
+ } , [ onDebugModalClose , onRequestCloseDebugModal ] ) ;
158
+
150
159
if ( isRendererSupported === null ) {
151
160
isRendererSupported = Renderer . isSupported ( ) ;
152
161
}
@@ -194,7 +203,10 @@ const GUIComponent = props => {
194
203
< WebGlModal isRtl = { isRtl } />
195
204
) }
196
205
{ tipsLibraryVisible ? (
197
- < TipsLibrary hideTutorialProjects = { hideTutorialProjects } />
206
+ < TipsLibrary
207
+ hideTutorialProjects = { hideTutorialProjects }
208
+ onTutorialSelect = { onTutorialSelect }
209
+ />
198
210
) : null }
199
211
{ cardsVisible ? (
200
212
< Cards />
@@ -215,7 +227,7 @@ const GUIComponent = props => {
215
227
) : null }
216
228
{ < DebugModal
217
229
isOpen = { debugModalVisible }
218
- onClose = { onRequestCloseDebugModal }
230
+ onClose = { onCloseDebugModal }
219
231
/> }
220
232
{ backdropLibraryVisible ? (
221
233
< BackdropLibrary
@@ -414,6 +426,8 @@ GUIComponent.propTypes = {
414
426
costumeLibraryVisible : PropTypes . bool ,
415
427
costumesTabVisible : PropTypes . bool ,
416
428
debugModalVisible : PropTypes . bool ,
429
+ onDebugModalClose : PropTypes . func ,
430
+ onTutorialSelect : PropTypes . func ,
417
431
enableCommunity : PropTypes . bool ,
418
432
intl : intlShape . isRequired ,
419
433
isCreating : PropTypes . bool ,
0 commit comments