lbry-desktop/ui/component/wunderbarSuggestions/index.js
infinite-persistence 052aa87ddd
Remove unused items
2021-07-14 11:13:13 +08:00

28 lines
1.1 KiB
JavaScript

import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
import { selectLanguage, selectShowMatureContent } from 'redux/selectors/settings';
import { doToast } from 'redux/actions/notifications';
import { doOpenModal, doHideModal } from 'redux/actions/app';
import { withRouter } from 'react-router';
import { doResolveUris } from 'lbry-redux';
import analytics from 'analytics';
import Wunderbar from './view';
const select = (state, props) => ({
language: selectLanguage(state),
showMature: selectShowMatureContent(state),
});
const perform = (dispatch, ownProps) => ({
doResolveUris: (uris) => dispatch(doResolveUris(uris)),
navigateToSearchPage: (query) => {
let encodedQuery = encodeURIComponent(query);
ownProps.history.push({ pathname: `/$/search`, search: `?q=${encodedQuery}` });
analytics.apiLogSearch();
},
doShowSnackBar: (message) => dispatch(doToast({ isError: true, message })),
doOpenMobileSearch: () => dispatch(doOpenModal(MODALS.MOBILE_SEARCH)),
doCloseMobileSearch: () => dispatch(doHideModal()),
});
export default withRouter(connect(select, perform)(Wunderbar));