mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
Merge global search.
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
import React from 'react';
|
||||
import {Switch, Route} from 'react-router';
|
||||
import { Switch, Route } from 'react-router';
|
||||
import Sidebar from 'components/Sidebar/Sidebar';
|
||||
import DashboardContent from 'components/Dashboard/DashboardContent';
|
||||
import DialogsContainer from 'components/DialogsContainer';
|
||||
import PreferencesContent from 'components/Preferences/PreferencesContent';
|
||||
import PreferencesSidebar from 'components/Preferences/PreferencesSidebar';
|
||||
import Search from 'containers/Dashboard/GeneralSearch/Search';
|
||||
|
||||
export default function() {
|
||||
export default function () {
|
||||
return (
|
||||
<div className="dashboard">
|
||||
<div className='dashboard'>
|
||||
<Switch>
|
||||
<Route path="/dashboard/preferences">
|
||||
<Route path='/dashboard/preferences'>
|
||||
<Sidebar />
|
||||
<PreferencesSidebar />
|
||||
<PreferencesContent />
|
||||
</Route>
|
||||
|
||||
<Route path="/dashboard">
|
||||
<Route path='/dashboard'>
|
||||
<Sidebar />
|
||||
<DashboardContent />
|
||||
</Route>
|
||||
</Switch>
|
||||
|
||||
<Search />
|
||||
<DialogsContainer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,17 +6,20 @@ import {
|
||||
NavbarGroup,
|
||||
Button,
|
||||
Classes,
|
||||
MenuDivider,
|
||||
MenuItem,
|
||||
Menu,
|
||||
Popover,
|
||||
} from '@blueprintjs/core';
|
||||
import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs';
|
||||
import DashboardTopbarUser from 'components/Dashboard/TopbarUser';
|
||||
import Icon from 'components/Icon';
|
||||
import Search from 'containers/Dashboard/GeneralSearch/Search';
|
||||
import SearchConnect from 'connectors/Search.connect';
|
||||
import { compose } from 'utils';
|
||||
|
||||
function DashboardTopbar({ pageTitle, pageSubtitle, editViewId }) {
|
||||
function DashboardTopbar({
|
||||
pageTitle,
|
||||
pageSubtitle,
|
||||
editViewId,
|
||||
globalSearchShow,
|
||||
openGlobalSearch,
|
||||
}) {
|
||||
const history = useHistory();
|
||||
|
||||
const handlerClickEditView = () => {
|
||||
@@ -70,8 +73,13 @@ function DashboardTopbar({ pageTitle, pageSubtitle, editViewId }) {
|
||||
<div class='dashboard__topbar-right'>
|
||||
<Navbar class='dashboard__topbar-navbar'>
|
||||
<NavbarGroup>
|
||||
{/* <Button className={Classes.MINIMAL} icon="home" text="Search" /> */}
|
||||
<Search className />
|
||||
<Button
|
||||
onClick={() => openGlobalSearch(true)}
|
||||
className={Classes.MINIMAL}
|
||||
icon='home'
|
||||
text='Search'
|
||||
/>
|
||||
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon='document'
|
||||
@@ -100,4 +108,7 @@ const mapStateToProps = (state) => ({
|
||||
editViewId: state.dashboard.topbarEditViewId,
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(DashboardTopbar);
|
||||
export default compose(
|
||||
SearchConnect,
|
||||
connect(mapStateToProps)
|
||||
)(DashboardTopbar);
|
||||
|
||||
Reference in New Issue
Block a user