mon-entreprise/containers/Explorer.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-06-29 10:27:04 +00:00
import React from 'react'
import {connect} from 'react-redux'
2016-07-04 16:34:18 +00:00
import TagNavigation from '../components/TagNavigation'
2016-07-05 14:08:36 +00:00
import Variables from '../components/Variables'
import * as actions from '../actions'
import {bindActionCreators} from 'redux'
import {tagsToSelectSelector, variablesSelector} from '../selectors'
class Explorer extends React.Component {
2016-06-29 10:27:04 +00:00
render() {
2016-07-28 14:01:25 +00:00
let {variables, selectedTags, selectedVariable, tagsToSelect, actions: {selectTag, resetTags, selectVariable}} = this.props
2016-06-29 16:57:56 +00:00
return (
<div>
<h1>Les prélèvements sociaux sur les salaires</h1>
2016-07-28 14:01:25 +00:00
<TagNavigation selectedTags={selectedTags} tagsToSelect={tagsToSelect} selectTag={selectTag} resetTags={resetTags}/>
<Variables variables={variables}
selectedTags={selectedTags} selectedVariable={selectedVariable}
selectVariable={selectVariable}/>
</div>
2016-06-29 16:57:56 +00:00
)
2016-06-29 10:27:04 +00:00
}
}
2016-06-30 10:16:47 +00:00
const mapStateToProps = state => (
{
selectedTags: state.selectedTags,
tagsToSelect: tagsToSelectSelector(state),
variables: variablesSelector(state),
selectedVariable: state.selectedVariable
}
)
const actionsToProps = dispatch => ({
actions: bindActionCreators(actions, dispatch)
})
const VariableExplorer = connect(mapStateToProps, actionsToProps)(Explorer)
export default VariableExplorer