Skip to content
Snippets Groups Projects
Commit f4daec51 authored by Christopher Willis-Ford's avatar Christopher Willis-Ford
Browse files

Don't bundle telemetry modal event handlers

parent ee80e07a
No related branches found
No related tags found
No related merge requests found
......@@ -104,12 +104,14 @@ const GUIComponent = props => {
onRequestCloseTelemetryModal,
onSeeCommunity,
onShare,
onTelemetryModalCancel,
onTelemetryModalOptIn,
onTelemetryModalOptOut,
previewInfoVisible,
showComingSoon,
soundsTabVisible,
stageSizeMode,
targetIsStage,
telemetryModalHandlers,
telemetryModalVisible,
tipsLibraryVisible,
vm,
......@@ -157,7 +159,9 @@ const GUIComponent = props => {
) : null}
{telemetryModalVisible ? (
<TelemetryModal
{...telemetryModalHandlers}
onCancel={onTelemetryModalCancel}
onOptIn={onTelemetryModalOptIn}
onOptOut={onTelemetryModalOptOut}
onRequestClose={onRequestCloseTelemetryModal}
/>
) : null}
......@@ -393,6 +397,9 @@ GUIComponent.propTypes = {
onSeeCommunity: PropTypes.func,
onShare: PropTypes.func,
onTabSelect: PropTypes.func,
onTelemetryModalCancel: PropTypes.func,
onTelemetryModalOptIn: PropTypes.func,
onTelemetryModalOptOut: PropTypes.func,
onToggleLoginOpen: PropTypes.func,
onUpdateProjectTitle: PropTypes.func,
previewInfoVisible: PropTypes.bool,
......@@ -401,11 +408,6 @@ GUIComponent.propTypes = {
soundsTabVisible: PropTypes.bool,
stageSizeMode: PropTypes.oneOf(Object.keys(STAGE_SIZE_MODES)),
targetIsStage: PropTypes.bool,
telemetryModalHandlers: PropTypes.shape({
onCancel: PropTypes.func,
onOptIn: PropTypes.func.isRequired,
onOptOut: PropTypes.func.isRequired
}),
telemetryModalVisible: PropTypes.bool,
tipsLibraryVisible: PropTypes.bool,
vm: PropTypes.instanceOf(VM).isRequired
......
......@@ -72,11 +72,15 @@ class TelemetryModal extends React.PureComponent {
}
handleOptIn () {
this.props.onRequestClose();
this.props.onOptIn();
if (this.props.onOptIn) {
this.props.onOptIn();
}
}
handleOptOut () {
this.props.onRequestClose();
this.props.onOptOut();
if (this.props.onOptOut) {
this.props.onOptOut();
}
}
render () {
return (<ReactModal
......
......@@ -70,11 +70,9 @@ export default appTarget => {
isScratchDesktop
showTelemetryModal
canSave={false}
telemetryModalHandlers={{
onCancel: handleTelemetryModalCancel,
onOptIn: handleTelemetryModalOptIn,
onOptOut: handleTelemetryModalOptOut
}}
onTelemetryModalCancel={handleTelemetryModalCancel}
onTelemetryModalOptIn={handleTelemetryModalOptIn}
onTelemetryModalOptOut={handleTelemetryModalOptOut}
/> :
<WrappedGui
backpackVisible
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment