lbry-desktop/ui/js/component/wunderbar/index.js

26 lines
613 B
JavaScript
Raw Normal View History

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
} from 'selectors/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) => ({
onSearch: (query) => dispatch(doNavigate('/search', { 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)