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