File tree Expand file tree Collapse file tree 3 files changed +32
-30
lines changed Expand file tree Collapse file tree 3 files changed +32
-30
lines changed Original file line number Diff line number Diff line change 1
1
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
- } ) ;
10
2
11
3
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 } ` } /> ;
24
5
} ;
25
6
26
7
export default StatusDot ;
Original file line number Diff line number Diff line change 178
178
}
179
179
180
180
.svg-inline--fa {
181
- // color: $blue-brand;
182
181
margin-right : 0.75em ;
183
182
display : inline-block ;
184
183
font-size : inherit ;
Original file line number Diff line number Diff line change 20
20
padding-left : 2px ;
21
21
}
22
22
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
-
32
23
#seriesname {
33
24
background-color : #333 ;
34
25
color : white ;
119
110
.buttons-container button :hover {
120
111
background-color : #f3f4f6 ;
121
112
}
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
+ }
You can’t perform that action at this time.
0 commit comments