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

cms/src/post/containers/Title.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 19
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
mnd 0
bc 0
fnc 1
dl 0
loc 19
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10
1
import { connect } from 'react-redux'
2
import { getPostTitle, getEditedTitle } from 'post/state/selectors'
3
import { editPostTitle } from 'post/state/actions'
4
import Title from 'post/components/Title'
5
6
const mapStateToProps = state => {
7
  const editedTitle = getEditedTitle(state)
8
  const title = getPostTitle(state)
9
  return {
10
    title: editedTitle || '',
11
    isEdited: editedTitle !== title
12
  }
13
}
14
15
const mapDispatchToProps = {
16
  editPostTitle
17
}
18
19
export default connect(mapStateToProps, mapDispatchToProps)(Title)
20