Skip to content

Commit 2bf48df

Browse files
committed
Added styling to the component cards indicating the render of each component, added a renderingFrequency and performanceVisx scss files
> > Co-authored-by: Nkmai <[email protected]> Co-authored-by: lind-tania <[email protected]> Co-authored-by: rtviner <[email protected]> Co-authored-by: caitlinchan23 <[email protected]>  
1 parent 6f80f30 commit 2bf48df

11 files changed

+91
-24
lines changed

archive/.pre-v4-demo.gif.icloud

167 Bytes
Binary file not shown.

archive/pre-v4-demo.gif

-2.29 MB
Binary file not shown.

assets/.extension-console.gif.icloud

173 Bytes
Binary file not shown.

assets/.reactime-console.gif.icloud

172 Bytes
Binary file not shown.

assets/extension-console.gif

-2.47 MB
Binary file not shown.

assets/reactime-console.gif

-6.16 MB
Binary file not shown.

src/app/components/PerformanceVisx.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import snapshots from './snapshots';
1313
import { onHover, onHoverExit } from '../actions/actions';
1414
import { useStoreContext } from '../store'
1515
import RenderingFrequency from './RenderingFrequency';
16-
import FormControlLabel from '@material-ui/core/FormControlLabel';
17-
import Switch from '@material-ui/core/Switch';
16+
// import FormControlLabel from '@material-ui/core/FormControlLabel';
17+
// import Switch from '@material-ui/core/Switch';
1818

1919
/* NOTES
2020
Issue - Not fully compatible with recoil apps. Reference the recoil-todo-test.
@@ -328,7 +328,10 @@ const PerformanceVisx = (props: BarStackProps) => {
328328
<div>
329329
{view === 'frequencyCards' */}
330330
{/* ? */}
331-
<RenderingFrequency data={data.componentData}/>
331+
332+
<div id='RenderContainer'>
333+
<RenderingFrequency data={data.componentData}/>
334+
</div>
332335
{/* : <BarGraph data={data}/>
333336
}
334337
</div> */}
Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react'
21

2+
import React from 'react';
33

44

55
const RenderingFrequency = (props) => {
@@ -12,17 +12,28 @@ const RenderingFrequency = (props) => {
1212
Object.keys(perfData).map( componentName => {
1313
const currentComponent = perfData[componentName]
1414
return (
15-
<div>
16-
<h2>{componentName} </h2>
17-
<p>{currentComponent.stateType}</p>
18-
<div>Render Count: {currentComponent.renderFrequency} </div>
19-
<p>Average Time: {(currentComponent.totalRenderTime/currentComponent.renderFrequency).toFixed(3) } ms</p>
20-
</div>
21-
)
15+
<div className="StyledGridElement">
16+
<div className="RenderLeft">
17+
<h3>{componentName} </h3>
18+
<h4>{currentComponent.stateType}</h4>
19+
<h4>
20+
average time:{' '}
21+
{(
22+
currentComponent.totalRenderTime /
23+
currentComponent.renderFrequency
24+
).toFixed(3)}{' '}
25+
ms
26+
</h4>
27+
</div>
28+
<div className="RenderRight">
29+
<p>{currentComponent.renderFrequency}</p>
30+
</div>
31+
</div>
32+
);
2233
})
2334
}
2435
</div>
2536
)
2637
}
2738

28-
export default RenderingFrequency
39+
export default RenderingFrequency;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#RenderContainer {
2+
display: flex;
3+
justify-content: center;
4+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.StyledGridElement {
2+
display: flex;
3+
// align-content: center;
4+
align-items: center;
5+
justify-content: space-between;
6+
background: #242529;
7+
padding: 20px;
8+
width: 40vh;
9+
height: 5vh;
10+
margin: 20px 10px;
11+
font-family: 'Roboto', sans-serif;
12+
border-radius: 5px;
13+
border: 1px solid rgba(184, 196, 194, 0.25);
14+
box-shadow: 2px 3px 4px 2px rgba(0, 0, 0, 0.2);
15+
16+
h3 {
17+
color: $text-color;
18+
margin-bottom: 5px;
19+
margin-top: 5px;
20+
text-transform: uppercase;
21+
font-size: 14px;
22+
font-weight: 500;
23+
}
24+
25+
h4 {
26+
color: $text-color;
27+
margin-bottom: 5px;
28+
margin-top: 5px;
29+
font-weight: 300;
30+
}
31+
32+
p {
33+
color: $brand-color;
34+
line-height: 20px;
35+
text-align: center;
36+
font-size: 18px;
37+
line-height: 18px;
38+
}
39+
}
40+
.RenderLeft {
41+
// padding: 10px;
42+
}
43+
.RenderRight {
44+
border-radius: 5px;
45+
background: $blue-color-gradient;
46+
width: 10%;
47+
padding: 0 0.5em;
48+
}

0 commit comments

Comments
 (0)