2017-05-04 05:44:08 +02:00
|
|
|
import React from 'react'
|
|
|
|
import {
|
|
|
|
connect
|
|
|
|
} from 'react-redux'
|
2017-05-10 03:33:13 +02:00
|
|
|
import lbryuri from 'lbryuri.js'
|
2017-05-04 05:44:08 +02:00
|
|
|
import {
|
|
|
|
selectWunderBarAddress,
|
|
|
|
selectWunderBarIcon
|
2017-05-11 02:59:47 +02:00
|
|
|
} from 'selectors/search'
|
|
|
|
import {
|
|
|
|
doSearch,
|
|
|
|
} from 'actions/search'
|
2017-05-04 05:44:08 +02:00
|
|
|
import {
|
|
|
|
doNavigate,
|
|
|
|
} from 'actions/app'
|
|
|
|
import Wunderbar from './view'
|
|
|
|
|
|
|
|
const select = (state) => ({
|
|
|
|
address: selectWunderBarAddress(state),
|
|
|
|
icon: selectWunderBarIcon(state)
|
|
|
|
})
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
2017-05-11 02:59:47 +02:00
|
|
|
onSearch: (query) => dispatch(doSearch(query)),
|
2017-05-10 03:33:13 +02:00
|
|
|
onSubmit: (query) => dispatch(doNavigate('/show', { uri: lbryuri.normalize(query) } ))
|
2017-05-04 05:44:08 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
export default connect(select, perform)(Wunderbar)
|