Passed
Push — master ( 6fca9e...82ba0d )
by Huu-Phat
02:25 queued 10s
created

cms/src/post/components/base/TextField.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 25
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 18
mnd 0
bc 0
fnc 1
dl 0
loc 25
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
ccs 1
cts 1
cp 1
rs 10
1
import { withStyles } from '@material-ui/core/styles'
2
import TextField from '@material-ui/core/TextField'
3
4 6
const ValidationTextField = withStyles(theme => ({
5
  root: {
6
    '& input:valid + fieldset': {
7
      borderWidth: 2
8
    },
9
    '& input:invalid + fieldset': {
10
      borderColor: 'red',
11
      borderWidth: 2
12
    },
13
    '& input:valid:hover + fieldset': {
14
      borderColor: theme.colors.primary
15
    },
16
    '& input:valid:focus + fieldset': {
17
      borderColor: theme.colors.primary,
18
      borderLeftWidth: 3,
19
      padding: '4px !important' // override inline-style
20
    },
21
    margin: theme.spacing(1)
22
  }
23
}))(TextField)
24
25
export default ValidationTextField
26