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

34 lines
803 B
JavaScript
Raw Normal View History

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