File tree Expand file tree Collapse file tree 2 files changed +28
-24
lines changed
templates/react/src/components/health-check Expand file tree Collapse file tree 2 files changed +28
-24
lines changed Original file line number Diff line number Diff line change 11import React , { useState , useEffect } from 'react'
22import axios from 'axios'
3- import { withStyles } from '@material-ui/core/styles'
4- import { red , green } from '@material-ui/core/colors'
5- import Radio from '@material-ui/core/Radio'
6-
7- const radioStyle = ( customColor ) => ( {
8- root : {
9- color : customColor ,
10- '&$checked' : {
11- color : customColor ,
12- } ,
13- } ,
14- checked : { } ,
15- } )
16-
17- const CustomRadio = ( customColor ) => (
18- withStyles ( radioStyle ( customColor ) ) ( props => < Radio checked = { true } color = "default" { ...props } /> )
19- )
20-
21- const GreenRadio = CustomRadio ( green [ 600 ] )
22- const RedRadio = CustomRadio ( red [ 600 ] )
23-
24- function StatusIcon ( props ) {
25- return props . value === 200 ? < GreenRadio /> : < RedRadio />
26- }
3+ import StatusIcon from './status-icon'
274
285function HealthCheck ( ) {
296 const [ data , setData ] = useState ( { status : { } } )
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { withStyles } from '@material-ui/core/styles'
3+ import { red , green } from '@material-ui/core/colors'
4+ import Radio from '@material-ui/core/Radio'
5+
6+ const radioStyle = ( customColor ) => ( {
7+ root : {
8+ color : customColor ,
9+ '&$checked' : {
10+ color : customColor ,
11+ } ,
12+ } ,
13+ checked : { } ,
14+ } )
15+
16+ const CustomRadio = ( customColor ) => (
17+ withStyles ( radioStyle ( customColor ) ) ( props => < Radio checked = { true } color = "default" { ...props } /> )
18+ )
19+
20+ const GreenRadio = CustomRadio ( green [ 600 ] )
21+ const RedRadio = CustomRadio ( red [ 600 ] )
22+
23+ function StatusIcon ( props ) {
24+ return props . value === 200 ? < GreenRadio /> : < RedRadio />
25+ }
26+
27+ export default StatusIcon
You can’t perform that action at this time.
0 commit comments