Skip to content

Commit 9a2093c

Browse files
committed
Adding Hovering Feature Styling
1 parent c7ad5a1 commit 9a2093c

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,17 @@
3838
},
3939
"contributors": [
4040
"Abaas Khorrami",
41+
"Ali Rahman",
4142
"Andy Wong",
4243
"Bryan Lee",
4344
"Becca Viner",
4445
"Caitlin Chan",
46+
"Caner Demir",
4547
"Carlos Perez",
48+
"Cole Styron",
4649
"Chris Flannery",
4750
"David Chai",
51+
"Dennis Lopez",
4852
"Edwin Menendez",
4953
"Ergi Shehu",
5054
"Gabriela Jardim Aquino",
@@ -55,6 +59,7 @@
5559
"Josh Kim",
5660
"Joshua Howard",
5761
"Kevin Fey",
62+
"Kevin Ngo",
5863
"Kim Mai Nguyen",
5964
"Nathanael Wa Mwenze",
6065
"Prasanna Malla",

src/app/components/StateRoute.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const StateRoute = (props: StateRouteProps) => {
141141
}}
142142
label='LCP'
143143
name='Largest Contentful Paint'
144-
description='Time website loads largest content on screen'
144+
description='Measures loading performance. The benchmark is less than 2500 ms.'
145145
/>
146146
<WebMetrics
147147
color={FIDColor}
@@ -151,23 +151,23 @@ const StateRoute = (props: StateRouteProps) => {
151151
}}
152152
label='FID'
153153
name='First Input Delay'
154-
description='Time from when a user first interacts with your site'
154+
description='Measures interactivity. The benchmark is less than 100 ms.'
155155
/>
156156
<WebMetrics
157157
color={FCPColor}
158158
series={(webMetrics.FCP / 1000) * 100}
159159
formatted={(val) => ((val / 100) * 1000).toFixed(2) + ' ms'}
160160
label='FCP'
161161
name='First Contentful Paint'
162-
description='How long it takes browser to render first piece of DOM content'
162+
description='How long it takes browser to render first piece of DOM content.'
163163
/>
164164
<WebMetrics
165165
color={TTFBColor}
166166
series={(webMetrics.TTFB / 10) * 100}
167167
formatted={(val) => ((val / 100) * 10).toFixed(2) + ' ms'}
168168
label='TTFB'
169169
name='Time to First Byte'
170-
description = 'Time at which your server sends a response'
170+
description='Measures the time it takes for a browser to receive the first byte of page content. The benchmark is 600 ms.'
171171
/>
172172
</div>
173173
);

src/app/components/WebMetrics.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ const radialGraph = (props) => {
104104
</div>
105105
</Trigger>
106106
<Hover type='hover'>
107-
<div id='hover-box'>
108-
<p> Metric : {props.name}</p>
109-
<p> Tracks : {props.description}</p>
107+
<div style={{ padding: '0.5rem 1rem' }} id='hover-box'>
108+
<p>
109+
<strong>{props.name}</strong>
110+
</p>
111+
<p>{props.description}</p>
110112
</div>
111113
</Hover>
112114
</ReactHover>

src/app/styles/layout/_stateContainer.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
grid-template-columns: auto auto;
191191
align-items: center;
192192
justify-content: center;
193-
margin-top: 1rem;
193+
margin-top: 25%;
194194
}
195195

196196
//container for metrics

src/backend/timeJump.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ export default (origin, mode) => {
6060
);
6161
const hookState = Object.values(hook);
6262

63-
if (hooksComponent && hooksComponent.dispatch) {
64-
hooksComponent.dispatch(hookState[0]);
63+
if ( hooksComponent && hooksComponent.dispatch) {
64+
if (Array.isArray(hookState[0]) && hookState[0].length > 0 || !Array.isArray(hookState[0])) {
65+
hooksComponent.dispatch(hookState[0]);
66+
}
6567
}
6668
});
6769
}

0 commit comments

Comments
 (0)