Skip to content

Commit 9cec304

Browse files
committed
full TS implementation on Tutorial.tsx
Co-authored-by: Mark Teets <[email protected]> Co-authored-by: Jasmine Noor <[email protected]> Co-authored-by: Minzo Kim <[email protected]> Co-authored-by: Jackie Yuan <[email protected]>
1 parent b448816 commit 9cec304

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

src/app/components/Tutorial.tsx

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,15 @@ import 'intro.js/introjs.css';
88
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
99
import { faQuestion } from '@fortawesome/free-solid-svg-icons';
1010
import { tutorialSaveSeriesToggle, setCurrentTabInApp } from '../actions/actions';
11+
import { TutorialProps, TutorialState, StepsObj } from '../components/FrontendTypes';
1112

1213
//Must be required in. This enables compatibility with TS. If imported in, throws ts error of not rendering steps as a class component correctly.
1314
const { Steps } = require('intro.js-react');
1415

15-
interface tutorialProps {
16-
dispatch: (object) => void;
17-
currentTabInApp: string;
18-
}
19-
20-
interface tutorialState {
21-
stepsEnabled: boolean;
22-
}
23-
2416
// This is the tutorial displayed when the "How to use" button is clicked
2517
// 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) {
2820
super(props);
2921
this.state = {
3022
stepsEnabled: false,
@@ -82,14 +74,8 @@ export default class Tutorial extends React.Component<tutorialProps, tutorialSta
8274
this.setState({ stepsEnabled: true });
8375
};
8476

85-
interface stepsObj {
86-
title: string;
87-
element?: string;
88-
intro: string;
89-
position: string;
90-
}
9177

92-
let steps: stepsObj[] = [];
78+
let steps: StepsObj[] = [];
9379

9480
switch (currentTabInApp) {
9581
case 'map':

0 commit comments

Comments
 (0)