2017-05-04 05:44:08 +02:00
|
|
|
import React from 'react'
|
|
|
|
import {
|
|
|
|
connect
|
|
|
|
} from 'react-redux'
|
|
|
|
import {
|
|
|
|
selectWunderBarAddress,
|
|
|
|
selectWunderBarIcon
|
|
|
|
} from 'selectors/app'
|
|
|
|
import {
|
|
|
|
doNavigate,
|
|
|
|
} from 'actions/app'
|
|
|
|
import {
|
|
|
|
doSearchContent,
|
|
|
|
doActivateSearch,
|
|
|
|
doDeactivateSearch,
|
|
|
|
} from 'actions/search'
|
|
|
|
import Wunderbar from './view'
|
|
|
|
|
|
|
|
const select = (state) => ({
|
|
|
|
address: selectWunderBarAddress(state),
|
|
|
|
icon: selectWunderBarIcon(state)
|
|
|
|
})
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
// navigate: (path) => dispatch(doNavigate(path)),
|
|
|
|
onSearch: (query) => dispatch(doSearchContent(query)),
|
|
|
|
onSubmit: (query) => dispatch(doSearchContent(query)),
|
2017-05-05 10:01:16 +02:00
|
|
|
activateSearch: () => dispatch(doActivateSearch()),
|
|
|
|
deactivateSearch: () => setTimeout(() => { dispatch(doDeactivateSearch()) }, 50),
|
2017-05-04 05:44:08 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
export default connect(select, perform)(Wunderbar)
|