4
4
InMemoryCache ,
5
5
gql ,
6
6
} from "@apollo/client" ;
7
- import { Typography , CardContent , IconButton } from "@mui/material" ;
7
+ import { Typography , CardContent , IconButton , Box } from "@mui/material" ;
8
8
import MonitorHeartIcon from '@mui/icons-material/MonitorHeart' ;
9
9
import ErrorIcon from '@mui/icons-material/Error' ;
10
10
import BugReportIcon from '@mui/icons-material/BugReport' ;
@@ -19,15 +19,11 @@ export const MetricCard = ({ type, index }) => {
19
19
const [ data , setData ] = useState ( null ) ;
20
20
21
21
const metricType = [ "Liveness Indicator" , "Error Rate" , "Error Queries" , "Bytes Consumed" ] ;
22
- const iconColor = [ "rgb(6, 27, 100)" , "rgb(4, 41, 122)" , "rgb(122, 79, 1)" , "rgb(122, 12, 46)" ] ;
23
22
const bgColor = [ "cardColor.background1" , "cardColor.background2" , "cardColor.background3" , "cardColor.background4" ] ;
24
- const textColor = [ "#061B64" , "#04297A" , "#7A4F01" , "#7A0C2E" ] ;
25
- const bgImage = [ `linear-gradient(135deg, rgba(16, 57, 150, 0) 0%, rgba(16, 57, 150, 0.24) 100%)` ,
26
- `linear-gradient(135deg, rgba(12, 83, 183, 0) 0%, rgba(12, 83, 183, 0.24) 100%)` ,
27
- `linear-gradient(135deg, rgba(183, 129, 3, 0) 0%, rgba(183, 129, 3, 0.24) 100%)` ,
28
- `linear-gradient(135deg, rgba(183, 33, 54, 0) 0%, rgba(183, 33, 54, 0.24) 100%)` ] ;
29
-
23
+ const textColor = [ "cardColor.textColor1" , "cardColor.textColor2" , "cardColor.textColor3" , "cardColor.textColor4" ] ;
24
+ const bgImage = [ "cardColor.iconBg1" , "cardColor.iconBg2" , "cardColor.iconBg3" , "cardColor.iconBg4" ] ;
30
25
26
+ console . log ( data ) ;
31
27
const flipCard = ( ) => {
32
28
// supposed to flip liveness card here
33
29
}
@@ -48,29 +44,30 @@ export const MetricCard = ({ type, index }) => {
48
44
49
45
return (
50
46
< CardContent
51
- sx = { { display : 'flex' , justifyContent : "center" , alignItems : "center" , flexDirection : "column" , bgcolor : bgColor [ index ] , boxShadow : 0 , borderRadius : '16px' } } >
52
- < IconButton
53
- size = "small"
54
- style = { { width : "2.9rem" , height : "2.9rem" , backgroundImage : bgImage [ index ] } }
55
- sx = { { color : iconColor [ index ] , borderRadius : '50%' } }
56
- onClick = { ( ) => console . log ( '' ) } // placeholder for flipping card
57
- >
58
- { index === 0 && < MonitorHeartIcon /> }
59
- { index === 1 && < ErrorIcon /> }
60
- { index === 2 && < BugReportIcon /> }
61
- { index === 3 && < DataThresholdingIcon /> }
62
- </ IconButton >
63
-
64
- < Typography variant = 'h3' sx = { { textAlign : 'center' , pt : '1.2rem' , fontWeight : 700 , lineHeight : 1.5 , fontSize : '1.8rem' , color : textColor [ index ] } } >
47
+ sx = { { display : 'flex' , justifyContent : "center" , alignItems : "center" , flexDirection : "column" , bgcolor : bgColor [ index ] , boxShadow : 1 , borderRadius : '16px' } } >
48
+ < Box width = "100%" sx = { { display : 'flex' , flexDirection : "row" , justifyContent : "flex-start" , alignItems : "center" } } >
49
+ < IconButton
50
+ size = "small"
51
+ // style={{ width: "2.9rem", height: "2.9rem" }}
52
+ sx = { { borderRadius : '50%' } }
53
+ onClick = { ( ) => console . log ( '' ) } // placeholder for flipping card
54
+ >
55
+ { index === 0 && < MonitorHeartIcon /> }
56
+ { index === 1 && < ErrorIcon /> }
57
+ { index === 2 && < BugReportIcon /> }
58
+ { index === 3 && < DataThresholdingIcon /> }
59
+ </ IconButton >
60
+ < Box >
61
+ < Typography variant = 'h6' sx = { { verticalAlign : 'center' , fontSize : '0.96rem' , opacity : 0.72 , color : textColor [ index ] } } >
62
+ { metricType [ index ] } </ Typography >
63
+ </ Box >
64
+ </ Box >
65
+ < Typography variant = 'h3' sx = { { fontSize : '1.8rem' } } >
65
66
{ index === 0 && ( data ? 'Running' : 'Down' ) }
66
67
{ index === 1 && ( data !== null ? data : 'N/A' ) }
67
68
{ index === 2 && ( data !== null ? data : 'N/A' ) }
68
69
{ index === 3 && ( data !== null ? data : 'N/A' ) }
69
70
</ Typography >
70
-
71
- < Typography variant = 'h6' sx = { { fontWeight : 600 , lineHeight : 1.5 , fontSize : '0.96rem' , opacity : 0.72 , color : textColor [ index ] } } >
72
- { metricType [ index ] } </ Typography >
73
-
74
71
</ CardContent >
75
72
76
73
)
0 commit comments