Skip to content

Commit 63573cb

Browse files
committed
styled reconnect green dot
1 parent 5cd0ef9 commit 63573cb

File tree

3 files changed

+32
-30
lines changed

3 files changed

+32
-30
lines changed
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11
import React from 'react';
2-
import styled from 'styled-components';
3-
4-
const Dot = styled('div')({
5-
borderRadius: '50%',
6-
width: '12px',
7-
height: '12px',
8-
display: 'inline-block',
9-
});
102

113
const StatusDot = ({ status }) => {
12-
let color: 'green' | 'red';
13-
switch (status) {
14-
case 'active':
15-
color = 'green';
16-
break;
17-
case 'inactive':
18-
color = 'red';
19-
break;
20-
default:
21-
color = 'green';
22-
}
23-
return <Dot style={{ backgroundColor: color }} />;
4+
return <span className={`status-dot ${status}`} />;
245
};
256

267
export default StatusDot;

src/app/styles/components/_buttons.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@
178178
}
179179

180180
.svg-inline--fa {
181-
//color: $blue-brand;
182181
margin-right: 0.75em;
183182
display: inline-block;
184183
font-size: inherit;

src/app/styles/layout/_buttonsContainer.scss

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@
2020
padding-left: 2px;
2121
}
2222

23-
.tools-container {
24-
display: flex;
25-
justify-content: space-between;
26-
border: 0.5px solid grey;
27-
background-color: #35383e;
28-
padding: 3px;
29-
margin-bottom: 1rem;
30-
}
31-
3223
#seriesname {
3324
background-color: #333;
3425
color: white;
@@ -119,3 +110,34 @@
119110
.buttons-container button:hover {
120111
background-color: #f3f4f6;
121112
}
113+
114+
.status-dot {
115+
display: inline-block;
116+
width: 10px;
117+
height: 10px;
118+
border-radius: 50%;
119+
}
120+
121+
.status-dot.active {
122+
background-color: #14b8a6;
123+
animation: pulse 2s infinite;
124+
}
125+
126+
.status-dot.inactive {
127+
background-color: #9ca3af;
128+
}
129+
130+
@keyframes pulse {
131+
0% {
132+
opacity: 1;
133+
transform: scale(1);
134+
}
135+
50% {
136+
opacity: 0.7;
137+
transform: scale(1.1);
138+
}
139+
100% {
140+
opacity: 1;
141+
transform: scale(1);
142+
}
143+
}

0 commit comments

Comments
 (0)