2017-04-22 15:17:01 +02:00
|
|
|
import React from 'react'
|
|
|
|
import {
|
|
|
|
connect
|
|
|
|
} from 'react-redux'
|
|
|
|
import {
|
|
|
|
selectCurrentPage,
|
|
|
|
selectHeaderLinks,
|
|
|
|
} from 'selectors/app'
|
|
|
|
import {
|
|
|
|
doNavigate,
|
|
|
|
} from 'actions/app'
|
2017-04-24 16:17:36 +02:00
|
|
|
import {
|
|
|
|
doSearchContent,
|
|
|
|
} from 'actions/search'
|
2017-04-22 15:17:01 +02:00
|
|
|
import Header from './view'
|
|
|
|
|
|
|
|
const select = (state) => ({
|
|
|
|
currentPage: selectCurrentPage(state),
|
|
|
|
subLinks: selectHeaderLinks(state),
|
|
|
|
})
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
navigate: (path) => dispatch(doNavigate(path)),
|
2017-04-24 16:17:36 +02:00
|
|
|
search: (query) => dispatch(doSearchContent(query)),
|
2017-04-22 15:17:01 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
export default connect(select, perform)(Header)
|