Skip to content

feat: [UEPR-176] add logic for triggering feedback from editor #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions packages/scratch-gui/src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import omit from 'lodash.omit';
import PropTypes from 'prop-types';
import React from 'react';
import React, {useCallback} from 'react';
import {defineMessages, FormattedMessage, injectIntl, intlShape} from 'react-intl';
import {connect} from 'react-redux';
import MediaQuery from 'react-responsive';
Expand Down Expand Up @@ -86,6 +86,8 @@ const GUIComponent = props => {
costumeLibraryVisible,
costumesTabVisible,
debugModalVisible,
onDebugModalClose,
onTutorialSelect,
enableCommunity,
intl,
isCreating,
Expand Down Expand Up @@ -147,6 +149,13 @@ const GUIComponent = props => {
tabSelected: classNames(tabStyles.reactTabsTabSelected, styles.isSelected)
};

const onCloseDebugModal = useCallback(() => {
if (onDebugModalClose) {
onDebugModalClose();
}
onRequestCloseDebugModal();
}, [onDebugModalClose, onRequestCloseDebugModal]);

if (isRendererSupported === null) {
isRendererSupported = Renderer.isSupported();
}
Expand Down Expand Up @@ -194,7 +203,10 @@ const GUIComponent = props => {
<WebGlModal isRtl={isRtl} />
)}
{tipsLibraryVisible ? (
<TipsLibrary hideTutorialProjects={hideTutorialProjects} />
<TipsLibrary
hideTutorialProjects={hideTutorialProjects}
onTutorialSelect={onTutorialSelect}
/>
) : null}
{cardsVisible ? (
<Cards />
Expand All @@ -215,7 +227,7 @@ const GUIComponent = props => {
) : null}
{<DebugModal
isOpen={debugModalVisible}
onClose={onRequestCloseDebugModal}
onClose={onCloseDebugModal}
/>}
{backdropLibraryVisible ? (
<BackdropLibrary
Expand Down Expand Up @@ -414,6 +426,8 @@ GUIComponent.propTypes = {
costumeLibraryVisible: PropTypes.bool,
costumesTabVisible: PropTypes.bool,
debugModalVisible: PropTypes.bool,
onDebugModalClose: PropTypes.func,
onTutorialSelect: PropTypes.func,
enableCommunity: PropTypes.bool,
intl: intlShape.isRequired,
isCreating: PropTypes.bool,
Expand Down
4 changes: 4 additions & 0 deletions packages/scratch-gui/src/containers/tips-library.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class TipsLibrary extends React.PureComponent {
return window.open(window.location.origin + urlParams, '_blank');
}

if (this.props.onTutorialSelect) {
this.props.onTutorialSelect();
}
this.props.onActivateDeck(item.id);
}
render () {
Expand Down Expand Up @@ -113,6 +116,7 @@ class TipsLibrary extends React.PureComponent {
}

TipsLibrary.propTypes = {
onTutorialSelect: PropTypes.func,
intl: intlShape.isRequired,
onActivateDeck: PropTypes.func.isRequired,
onRequestClose: PropTypes.func,
Expand Down
Loading