1
1
// @ts -nocheck
2
2
import * as React from 'react' ;
3
- import { useState , useEffect , Component } from 'react' ;
4
- import { useLocation , Redirect } from 'react-router-dom' ;
5
- import { Steps , Hints , updateStepElement } from 'intro.js-react' ;
3
+ import { Component } from 'react' ;
4
+ import { Steps } from 'intro.js-react' ;
6
5
import 'intro.js/introjs.css' ;
7
6
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
8
7
import { faQuestion } from '@fortawesome/free-solid-svg-icons' ;
9
- import { useStoreContext } from '../store' ;
10
8
import { tutorialSaveSeriesToggle , setCurrentTabInApp } from '../actions/actions' ;
11
9
12
10
// export default function Tutorial(): JSX.Element {
@@ -201,6 +199,7 @@ import { tutorialSaveSeriesToggle, setCurrentTabInApp } from '../actions/actions
201
199
// );
202
200
// }
203
201
202
+ // This needs to be a class component to be compatible with updateStepElement from intro.js
204
203
class Tutorial extends Component {
205
204
constructor ( props ) {
206
205
super ( props ) ;
@@ -216,10 +215,10 @@ class Tutorial extends Component {
216
215
if ( currentTabInApp === 'performance' && currentStepIndex === 1 ) {
217
216
dispatch ( tutorialSaveSeriesToggle ( 'inputBoxOpen' ) ) ;
218
217
this . steps . updateStepElement ( currentStepIndex ) ;
219
- } ;
218
+ }
220
219
if ( currentTabInApp === 'performance' && currentStepIndex === 2 ) {
221
220
this . steps . updateStepElement ( currentStepIndex ) ;
222
- } ;
221
+ }
223
222
if ( currentTabInApp === 'performance' && currentStepIndex === 4 ) {
224
223
dispatch ( tutorialSaveSeriesToggle ( 'saved' ) ) ;
225
224
this . steps . updateStepElement ( currentStepIndex ) ;
@@ -228,13 +227,13 @@ class Tutorial extends Component {
228
227
this . steps . updateStepElement ( currentStepIndex ) ;
229
228
dispatch ( setCurrentTabInApp ( 'performance-comparison' ) ) ;
230
229
}
230
+ if ( currentTabInApp === 'performance-comparison' && currentStepIndex === 6 ) {
231
+ dispatch ( tutorialSaveSeriesToggle ( false ) ) ;
232
+ }
231
233
} ;
232
234
233
235
const onExit = ( ) => {
234
236
this . setState ( { stepsEnabled : false } ) ;
235
- if ( currentTabInApp === 'performance' || currentTabInApp === 'performance-comparison' || currentTabInApp === 'performance-component-details' ) {
236
- dispatch ( tutorialSaveSeriesToggle ( false ) ) ;
237
- }
238
237
} ;
239
238
const startIntro = ( ) => {
240
239
if ( currentTabInApp === 'performance' || currentTabInApp === 'performance-comparison' || currentTabInApp === 'performance-component-details' ) {
0 commit comments