Skip to content

Commit a655f13

Browse files
authored
Merge pull request #11 from oslabs-beta/andrewb
Andrewb
2 parents 59860c5 + 875d2c2 commit a655f13

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
/* eslint-disable jsx-a11y/no-static-element-interactions */
33
/* eslint-disable react/prop-types */
44
import React, { useState, useEffect } from 'react';
5-
import { onHover, onHoverExit, setCurrentTabInApp } from '../../../actions/actions';
6-
import { useStoreContext } from '../../../store';
5+
// import { onHover, onHoverExit, setCurrentTabInApp } from '../../../actions/actions';
6+
import { setCurrentTabInApp } from '../../../RTKslices';
7+
// import { useStoreContext } from '../../../store';
8+
import { useDispatch, useSelector } from 'react-redux';
79

810
/*
911
1012
*/
1113

1214
const RenderingFrequency = (props) => {
1315
const perfData = props.data;
14-
const [store, dispatch] = useStoreContext();
15-
16+
// const [store, dispatch] = useStoreContext();
17+
const dispatch = useDispatch();
1618
useEffect(() => {
1719
dispatch(setCurrentTabInApp('performance-comparison')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'performance-comparison' to facilitate render.
1820
}, []);
@@ -41,7 +43,9 @@ const RenderingFrequency = (props) => {
4143

4244
const ComponentCard = (props): JSX.Element => {
4345
const { componentName, stateType, averageRenderTime, renderFrequency, information } = props;
44-
const [{ tabs, currentTab }, dispatch] = useStoreContext();
46+
// const [{ tabs, currentTab }, dispatch] = useStoreContext();
47+
// const tabs = useSelector((state:any)=>state.main.tabs)
48+
// const currentTab = useSelector((state:any)=>state.main.currentTab);
4549
const [expand, setExpand] = useState(false);
4650

4751
// render time for each component from each snapshot

src/app/components/WebMetrics.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import React, { useEffect } from 'react';
22
import Charts from 'react-apexcharts';
33
import ReactHover, { Trigger, Hover } from 'react-hover';
44
import { OptionsCursorTrueWithMargin } from '../FrontendTypes';
5-
import { setCurrentTabInApp } from '../actions/actions';
6-
import { useStoreContext } from '../store';
7-
5+
// import { setCurrentTabInApp } from '../actions/actions';
6+
import { setCurrentTabInApp } from '../RTKslices'
7+
// import { useStoreContext } from '../store';
8+
import { useDispatch } from 'react-redux';
89
/*
910
Used to render a single radial graph on the 'Web Metrics' tab
1011
*/
1112

1213
const radialGraph = (props) => {
14+
const dispatch = useDispatch();
1315
const state = {
1416
series: [props.series], // series appears to be the scale at which data is displayed based on the type of webMetrics measured.
1517
options: {
@@ -92,7 +94,8 @@ const radialGraph = (props) => {
9294
},
9395
};
9496

95-
const [store, dispatch] = useStoreContext(); // used to get the dispatch function from our storeContext
97+
// const [store, dispatch] = useStoreContext(); // used to get the dispatch function from our storeContext
98+
9699
useEffect(() => {
97100
dispatch(setCurrentTabInApp('webmetrics')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'webmetrics' to facilitate render.
98101
}, []);

0 commit comments

Comments
 (0)