11import classNames from 'classnames' ;
22import omit from 'lodash.omit' ;
33import PropTypes from 'prop-types' ;
4- import React from 'react' ;
4+ import React , { useCallback } from 'react' ;
55import { defineMessages , FormattedMessage , injectIntl , intlShape } from 'react-intl' ;
66import { connect } from 'react-redux' ;
77import MediaQuery from 'react-responsive' ;
@@ -86,6 +86,8 @@ const GUIComponent = props => {
8686 costumeLibraryVisible,
8787 costumesTabVisible,
8888 debugModalVisible,
89+ displayDebugFeedback,
90+ displayTutorialsFeedback,
8991 enableCommunity,
9092 intl,
9193 isCreating,
@@ -147,6 +149,13 @@ const GUIComponent = props => {
147149 tabSelected : classNames ( tabStyles . reactTabsTabSelected , styles . isSelected )
148150 } ;
149151
152+ const onDebugModalClose = useCallback ( ( ) => {
153+ if ( displayDebugFeedback ) {
154+ displayDebugFeedback ( ) ;
155+ }
156+ onRequestCloseDebugModal ( ) ;
157+ } , [ displayDebugFeedback , onRequestCloseDebugModal ] ) ;
158+
150159 if ( isRendererSupported === null ) {
151160 isRendererSupported = Renderer . isSupported ( ) ;
152161 }
@@ -194,7 +203,10 @@ const GUIComponent = props => {
194203 < WebGlModal isRtl = { isRtl } />
195204 ) }
196205 { tipsLibraryVisible ? (
197- < TipsLibrary hideTutorialProjects = { hideTutorialProjects } />
206+ < TipsLibrary
207+ hideTutorialProjects = { hideTutorialProjects }
208+ displayTutorialsFeedback = { displayTutorialsFeedback }
209+ />
198210 ) : null }
199211 { cardsVisible ? (
200212 < Cards />
@@ -215,7 +227,7 @@ const GUIComponent = props => {
215227 ) : null }
216228 { < DebugModal
217229 isOpen = { debugModalVisible }
218- onClose = { onRequestCloseDebugModal }
230+ onClose = { onDebugModalClose }
219231 /> }
220232 { backdropLibraryVisible ? (
221233 < BackdropLibrary
@@ -414,6 +426,8 @@ GUIComponent.propTypes = {
414426 costumeLibraryVisible : PropTypes . bool ,
415427 costumesTabVisible : PropTypes . bool ,
416428 debugModalVisible : PropTypes . bool ,
429+ displayDebugFeedback : PropTypes . func ,
430+ displayTutorialsFeedback : PropTypes . func ,
417431 enableCommunity : PropTypes . bool ,
418432 intl : intlShape . isRequired ,
419433 isCreating : PropTypes . bool ,
0 commit comments