@@ -8,23 +8,15 @@ import 'intro.js/introjs.css';
8
8
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
9
9
import { faQuestion } from '@fortawesome/free-solid-svg-icons' ;
10
10
import { tutorialSaveSeriesToggle , setCurrentTabInApp } from '../actions/actions' ;
11
+ import { TutorialProps , TutorialState , StepsObj } from '../components/FrontendTypes' ;
11
12
12
13
//Must be required in. This enables compatibility with TS. If imported in, throws ts error of not rendering steps as a class component correctly.
13
14
const { Steps } = require ( 'intro.js-react' ) ;
14
15
15
- interface tutorialProps {
16
- dispatch : ( object ) => void ;
17
- currentTabInApp : string ;
18
- }
19
-
20
- interface tutorialState {
21
- stepsEnabled : boolean ;
22
- }
23
-
24
16
// This is the tutorial displayed when the "How to use" button is clicked
25
17
// This needs to be a class component to be compatible with updateStepElement from intro.js
26
- export default class Tutorial extends React . Component < tutorialProps , tutorialState > {
27
- constructor ( props : tutorialProps ) {
18
+ export default class Tutorial extends Component < TutorialProps , TutorialState > {
19
+ constructor ( props : TutorialProps ) {
28
20
super ( props ) ;
29
21
this . state = {
30
22
stepsEnabled : false ,
@@ -82,14 +74,8 @@ export default class Tutorial extends React.Component<tutorialProps, tutorialSta
82
74
this . setState ( { stepsEnabled : true } ) ;
83
75
} ;
84
76
85
- interface stepsObj {
86
- title : string ;
87
- element ?: string ;
88
- intro : string ;
89
- position : string ;
90
- }
91
77
92
- let steps : stepsObj [ ] = [ ] ;
78
+ let steps : StepsObj [ ] = [ ] ;
93
79
94
80
switch ( currentTabInApp ) {
95
81
case 'map' :
0 commit comments