Skip to content

Commit e84062f

Browse files
yuanjackie1MarkTeetsjasnoominzo-kim
committed
Full TS for LinkControls.tsx/ PerformanceVisx.tsx
Co-authored-by: Mark Teets <[email protected]> Co-authored-by: Jasmine Noor <[email protected]> Co-authored-by: Minzo Kim <[email protected]>
1 parent 1d03904 commit e84062f

File tree

2 files changed

+8
-28
lines changed

2 files changed

+8
-28
lines changed

src/app/components/StateRoute/ComponentMap/LinkControls.tsx

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/* eslint-disable jsx-a11y/label-has-associated-control */
22
import React from 'react';
3+
import { LinkControlProps, ControlStyles, DropDownStyle, Node } from '../../../components/FrontendTypes'
34
// Font size of the Controls label and Dropdowns
4-
const controlStyles = {
5+
const controlStyles: ControlStyles = {
56
fontSize: '12px',
67
padding: '10px',
78
};
8-
9-
const dropDownStyle = {
9+
10+
const dropDownStyle: DropDownStyle = {
1011
margin: '0.5em',
1112
fontSize: '12px',
1213
fontFamily: 'Roboto, sans-serif',
@@ -18,24 +19,10 @@ const dropDownStyle = {
1819
padding: '2px',
1920
};
2021

21-
type Props = {
22-
layout: string;
23-
orientation: string;
24-
linkType: string;
25-
stepPercent: number;
26-
selectedNode: string;
27-
setLayout: (layout: string) => void;
28-
setOrientation: (orientation: string) => void;
29-
setLinkType: (linkType: string) => void;
30-
setStepPercent: (percent: number) => void;
31-
setSelectedNode: (selectedNode: string) => void;
32-
snapShots: Record<string, unknown>;
33-
};
34-
3522
// use BFS to put all the nodes under snapShots(which is the tree node) into an array
36-
const nodeList = [];
23+
const nodeList: Node[] = [];
3724

38-
const collectNodes = (node): void => {
25+
const collectNodes = (node: Node): void => {
3926
nodeList.splice(0, nodeList.length);
4027
/* We used the .splice method here to ensure that nodeList
4128
did not accumulate with page refreshes */
@@ -58,7 +45,7 @@ export default function LinkControls({
5845
setStepPercent,
5946
setSelectedNode,
6047
snapShots,
61-
}: Props): JSX.Element {
48+
}: LinkControlProps): JSX.Element {
6249
collectNodes(snapShots);
6350

6451
return (

src/app/components/StateRoute/PerformanceVisx/PerformanceVisx.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@ import BarGraphComparison from './BarGraphComparison';
1010
import BarGraphComparisonActions from './BarGraphComparisonActions';
1111
import { useStoreContext } from '../../../store';
1212
import { setCurrentTabInApp } from '../../../actions/actions';
13-
import { PerfData, Series } from '../../FrontendTypes';
14-
15-
interface PerformanceVisxProps {
16-
width: number;
17-
height: number;
18-
snapshots: [];
19-
hierarchy: any;
20-
}
13+
import { PerfData, Series, PerformanceVisxProps } from '../../FrontendTypes';
2114

2215
const collectNodes = (snaps, componentName) => {
2316
const componentsResult = [];

0 commit comments

Comments
 (0)