1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-09 22:45:01 +00:00
mon-entreprise/containers/Explorer.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-06-29 12:27:04 +02:00
import React from 'react'
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'
import * as actions from '../actions'
import {bindActionCreators} from 'redux'
import {tagsToSelectSelector, variablesSelector} from '../selectors/selectors'
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 (
<div>
<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}/>
<Variables variables={variables}
selectedTags={selectedTags} selectedVariable={selectedVariable}
selectVariable={selectVariable}/>
</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
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