Skip to content

Commit ce65c0b

Browse files
committed
refactored code to remove console logs and fixed bugs
1 parent c1dbbf3 commit ce65c0b

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/app/FrontendTypes.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,16 @@ export interface Snapshots {
384384
export interface ErrorContainerProps {
385385
port: chrome.runtime.Port | null;
386386
}
387+
388+
export interface AxContainer {
389+
axSnapshots: [];
390+
snapshot: {
391+
name?: string;
392+
componentData?: object;
393+
state?: string | object;
394+
stateSnaphot?: object;
395+
children?: any[];
396+
};
397+
snapshots: [];
398+
currLocation: object;
399+
}

src/app/components/StateRoute/AxContainer.tsx renamed to src/app/components/StateRoute/AxMap/AxMap.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from "react";
22
import { ParentSize } from '@visx/responsive';
3-
import AxTree from "./AxMap/Ax";
3+
import AxTree from "./Ax";
4+
import { AxContainer } from "../../../FrontendTypes";
45

5-
const AxContainer = (props) => {
6+
// Container to hold AxTree. AxTree is conditionally rendered based on the state of the setter function "showTree" in StateRoute
7+
8+
const AxContainer = (props: AxContainer) => {
69
const {
710
axSnapshots, // from 'tabs[currentTab]' object in 'MainContainer'
811
snapshot, // from 'tabs[currentTab]' object in 'MainContainer'

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ import { useDispatch, useSelector } from 'react-redux';
1515
import PerformanceVisx from './PerformanceVisx/PerformanceVisx';
1616
import WebMetricsContainer from './WebMetrics/WebMetricsContainer';
1717
import { MainState, RootState, StateRouteProps } from '../../FrontendTypes';
18-
import AxTree from './AxMap/Ax';
19-
import AxContainer from './AxContainer';
20-
import { divide } from 'lodash';
18+
import AxContainer from './AxMap/AxMap';
19+
2120

2221
/*
2322
Loads the appropriate StateRoute view and renders the Map, Performance, History, Webmetrics, and Tree navbar buttons after clicking on the 'State' button located near the top rightmost corner.

0 commit comments

Comments
 (0)