2016-06-29 10:27:04 +00:00
|
|
|
import React from 'react'
|
2016-07-04 15:28:30 +00:00
|
|
|
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'
|
2016-07-05 09:16:08 +00:00
|
|
|
import * as actions from '../actions'
|
|
|
|
import {bindActionCreators} from 'redux'
|
2016-07-25 19:58:11 +00:00
|
|
|
import {tagsToSelectSelector, variablesSelector} from '../selectors'
|
2016-07-04 15:28:30 +00:00
|
|
|
|
2016-07-05 09:16:08 +00:00
|
|
|
|
2016-07-04 15:28:30 +00:00
|
|
|
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 (
|
2016-07-04 15:28:30 +00:00
|
|
|
<div>
|
2016-07-25 19:58:11 +00:00
|
|
|
<h1>Les prélèvements sociaux sur les salaires en France</h1>
|
2016-07-28 14:01:25 +00:00
|
|
|
<TagNavigation selectedTags={selectedTags} tagsToSelect={tagsToSelect} selectTag={selectTag} resetTags={resetTags}/>
|
2016-07-25 19:58:11 +00:00
|
|
|
<Variables variables={variables}
|
|
|
|
selectedTags={selectedTags} selectedVariable={selectedVariable}
|
|
|
|
selectVariable={selectVariable}/>
|
2016-07-04 15:28:30 +00:00
|
|
|
</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
|
|
|
|
2016-07-04 15:28:30 +00:00
|
|
|
|
2016-07-04 15:39:56 +00:00
|
|
|
const mapStateToProps = state => (
|
2016-07-04 15:28:30 +00:00
|
|
|
{
|
2016-07-05 09:16:08 +00:00
|
|
|
selectedTags: state.selectedTags,
|
2016-07-25 19:58:11 +00:00
|
|
|
tagsToSelect: tagsToSelectSelector(state),
|
|
|
|
variables: variablesSelector(state),
|
|
|
|
selectedVariable: state.selectedVariable
|
2016-07-04 15:28:30 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-07-05 09:16:08 +00:00
|
|
|
const actionsToProps = dispatch => ({
|
|
|
|
actions: bindActionCreators(actions, dispatch)
|
|
|
|
})
|
|
|
|
|
|
|
|
const VariableExplorer = connect(mapStateToProps, actionsToProps)(Explorer)
|
2016-07-04 15:28:30 +00:00
|
|
|
|
|
|
|
export default VariableExplorer
|