Skip to content

Commit 2cdf439

Browse files
committed
changed type to interface and imported
1 parent 48cca97 commit 2cdf439

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,15 @@ import LinkControls from './LinkControls';
1919
import getLinkComponent from './getLinkComponent';
2020
import { toggleExpanded, setCurrentTabInApp } from '../../../actions/actions';
2121
import { useStoreContext } from '../../../store';
22+
import { LinkTypesProps, DefaultMargin, ToolTipStyles } from '../../../components/FrontendTypes'
2223

23-
const defaultMargin: {} = {
24+
const defaultMargin: DefaultMargin = {
2425
top: 30,
2526
left: 30,
2627
right: 55,
2728
bottom: 70,
2829
};
2930

30-
export type LinkTypesProps = {
31-
width: number;
32-
height: number;
33-
margin?: { top: number; right: number; bottom: number; left: number };
34-
snapshots: Record<string, unknown>;
35-
currentSnapshot?: Record<string, unknown>;
36-
};
3731

3832
export default function ComponentMap({
3933
// imported props to be used to display the dendrogram
@@ -95,7 +89,7 @@ export default function ComponentMap({
9589
scroll: true,
9690
});
9791

98-
const tooltipStyles: {} = {
92+
const tooltipStyles: ToolTipStyles = {
9993
...defaultStyles,
10094
minWidth: 60,
10195
maxWidth: 300,

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const StateRoute = (props: StateRouteProps) => {
2727
const { hierarchy, sliderIndex, viewIndex } = tabs[currentTab];
2828

2929
// Map
30-
const renderComponentMap = (): JSX.Element => {
30+
const renderComponentMap = () => {
3131
if (hierarchy) {
3232
return (
3333
<ParentSize className='componentMapContainer'>
@@ -50,7 +50,7 @@ const StateRoute = (props: StateRouteProps) => {
5050
// if true, we invoke the D3 render chart with hierarchy
5151
// by invoking History component, and passing in all the props required to render D3 elements and perform timeJump from clicking of node
5252
// otherwise we send an alert to the user that no state was found.
53-
const renderHistory = (): JSX.Element => {
53+
const renderHistory:JSX.Element = () => {
5454
if (hierarchy) {
5555
return (
5656
<ParentSize>

0 commit comments

Comments
 (0)