mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
Fix & connectors folder
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { Omnibar } from '@blueprintjs/select';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
import { compose } from 'utils';
|
||||
import SearchConnect from 'connectors/Search.connect';
|
||||
import withSearch from 'containers/GeneralSearch/withSearch';
|
||||
|
||||
function Search({
|
||||
resultSearch,
|
||||
@@ -30,7 +30,7 @@ function Search({
|
||||
<Omnibar
|
||||
className={'navbar-omnibar'}
|
||||
isOpen={globalSearchShow}
|
||||
noResults={<MenuItem disabled={true} text='No results.' />}
|
||||
noResults={<MenuItem disabled={true} text="No results." />}
|
||||
onClose={() => closeGlobalSearch(false)}
|
||||
resetOnSelect={true}
|
||||
itemRenderer={renderSearch}
|
||||
@@ -41,4 +41,4 @@ function Search({
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(SearchConnect)(Search);
|
||||
export default compose(withSearch)(Search);
|
||||
|
||||
15
client/src/containers/GeneralSearch/withSearch.js
Normal file
15
client/src/containers/GeneralSearch/withSearch.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { connect } from 'react-redux';
|
||||
import t from 'store/types';
|
||||
|
||||
export const mapStateToProps = (state, props) => ({
|
||||
resultSearch: state.globalSearch.searches,
|
||||
globalSearchShow: state.globalSearch.isOpen,
|
||||
});
|
||||
|
||||
export const mapDispatchToProps = (dispatch) => ({
|
||||
openGlobalSearch: (result) => dispatch({ type: t.OPEN_SEARCH, }),
|
||||
closeGlobalSearch: (result) => dispatch({ type: t.CLOSE_SEARCH }),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
Reference in New Issue
Block a user