|
1 |
| -// @ts-nocheck |
| 1 | +//@ts-nocheck |
2 | 2 | import * as React from 'react';
|
3 | 3 | import { Component } from 'react';
|
4 | 4 | import { Steps } from 'intro.js-react';
|
5 | 5 | import 'intro.js/introjs.css';
|
6 | 6 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
7 | 7 | import { faQuestion } from '@fortawesome/free-solid-svg-icons';
|
8 | 8 | import { tutorialSaveSeriesToggle, setCurrentTabInApp } from '../actions/actions';
|
9 |
| -import { element } from 'prop-types'; |
| 9 | + |
| 10 | +type tutorialProps = Record<string, unknown> |
10 | 11 |
|
11 | 12 | // This is the tutorial displayed when the "How to use" button is clicked
|
12 | 13 | // This needs to be a class component to be compatible with updateStepElement from intro.js
|
13 |
| -class Tutorial extends Component { |
14 |
| - constructor(props) { |
| 14 | +class Tutorial extends React.Component<tutorialProps> { |
| 15 | + constructor(props:tutorialProps) { |
15 | 16 | super(props);
|
16 | 17 | this.state = {
|
17 | 18 | stepsEnabled: false,
|
18 | 19 | };
|
19 | 20 | }
|
20 | 21 |
|
21 |
| - render() { |
| 22 | + render(): JSX.Element { |
22 | 23 | const { currentTabInApp, dispatch } = this.props;
|
23 |
| - |
| 24 | + |
24 | 25 | // This updates the steps so that they can target dynamically rendered elements
|
25 |
| - const onChangeHandler = (currentStepIndex: Number) => { |
| 26 | + const onChangeHandler = (currentStepIndex: number) => { |
26 | 27 | if (currentTabInApp === 'performance' && currentStepIndex === 1) {
|
27 | 28 | dispatch(tutorialSaveSeriesToggle('inputBoxOpen'));
|
28 | 29 | this.steps.updateStepElement(currentStepIndex);
|
@@ -58,15 +59,14 @@ class Tutorial extends Component {
|
58 | 59 | };
|
59 | 60 |
|
60 | 61 | interface stepsObj {
|
61 |
| - title: String, |
62 |
| - element?: String, |
63 |
| - intro: String, |
64 |
| - position: String, |
| 62 | + title: string, |
| 63 | + element?: string, |
| 64 | + intro: string, |
| 65 | + position: string, |
65 | 66 | }
|
66 | 67 |
|
67 | 68 | let steps: stepsObj[] = [];
|
68 | 69 |
|
69 |
| - |
70 | 70 | switch (currentTabInApp) {
|
71 | 71 | case 'map':
|
72 | 72 | steps = [{
|
@@ -210,9 +210,6 @@ class Tutorial extends Component {
|
210 | 210 | break;
|
211 | 211 | }
|
212 | 212 |
|
213 |
| - |
214 |
| - |
215 |
| - |
216 | 213 | return (
|
217 | 214 | <>
|
218 | 215 | <Steps
|
|
0 commit comments