| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 19 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { connect } from 'react-redux' |
||
| 2 | import { getPostAuthor, getEditedAuthor } from 'post/state/selectors' |
||
| 3 | import { editPostAuthor } from 'post/state/actions' |
||
| 4 | import Author from 'post/components/Author' |
||
| 5 | |||
| 6 | const mapStateToProps = state => { |
||
| 7 | const editedAuthor = getEditedAuthor(state) |
||
| 8 | const author = getPostAuthor(state) |
||
| 9 | return { |
||
| 10 | author: editedAuthor || '', |
||
| 11 | isEdited: editedAuthor !== author |
||
| 12 | } |
||
| 13 | } |
||
| 14 | |||
| 15 | const mapDispatchToProps = { |
||
| 16 | editPostAuthor |
||
| 17 | } |
||
| 18 | |||
| 19 | export default connect(mapStateToProps, mapDispatchToProps)(Author) |
||
| 20 |