diff --git a/client/src/components/Dashboard/Dashboard.js b/client/src/components/Dashboard/Dashboard.js index d24660695..49c2162a8 100644 --- a/client/src/components/Dashboard/Dashboard.js +++ b/client/src/components/Dashboard/Dashboard.js @@ -1,27 +1,29 @@ 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 ( -
+
- + - + +
); -} \ No newline at end of file +} diff --git a/client/src/components/Dashboard/DashboardTopbar.js b/client/src/components/Dashboard/DashboardTopbar.js index 7b551f7fa..dd4a3631e 100644 --- a/client/src/components/Dashboard/DashboardTopbar.js +++ b/client/src/components/Dashboard/DashboardTopbar.js @@ -14,9 +14,16 @@ import { 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 +77,13 @@ function DashboardTopbar({ pageTitle, pageSubtitle, editViewId }) {
- {/*
); diff --git a/client/src/store/reducers.js b/client/src/store/reducers.js index 47cb60597..d476baf29 100644 --- a/client/src/store/reducers.js +++ b/client/src/store/reducers.js @@ -14,7 +14,7 @@ import financialStatements from './financialStatement/financialStatements.reduce import itemCategories from './itemCategories/itemsCategory.reducer'; import settings from './settings/settings.reducer'; import manualJournals from './manualJournals/manualJournals.reducers'; -import search from './search/search.reducer'; +import globalSearch from './search/search.reducer'; export default combineReducers({ authentication, @@ -31,5 +31,5 @@ export default combineReducers({ items, itemCategories, settings, - search, + globalSearch, }); diff --git a/client/src/store/search/search.actions.js b/client/src/store/search/search.actions.js index e9bceac84..b1d3a44ed 100644 --- a/client/src/store/search/search.actions.js +++ b/client/src/store/search/search.actions.js @@ -1,5 +1,19 @@ import t from 'store/types'; +export function openSearch(result) { + return { + type: t.OPEN_SEARCH, + result, + }; +} + +export function closeSearch(result) { + return { + type: t.ClOSE_SEARCH, + result, + }; +} + export function generalSearch(name, result) { return { type: t.SEARCH_SUCCESS, diff --git a/client/src/store/search/search.reducer.js b/client/src/store/search/search.reducer.js index 583f12123..c0ccf7ca7 100644 --- a/client/src/store/search/search.reducer.js +++ b/client/src/store/search/search.reducer.js @@ -2,32 +2,14 @@ import t from 'store/types'; import { createReducer } from '@reduxjs/toolkit'; const initialState = { - searches: {}, - searchTitle: 'Title', isOpen: false, }; export default createReducer(initialState, { - [t.SEARCH_SUCCESS]: (state, action) => { - const _result = {}; - - action.searches.forEach((search) => { - _result[search.id] = search; - }); - - state.searches = { - ...state.searches, - ..._result, - }; + [t.OPEN_SEARCH]: (state, action) => { + state.isOpen = true; + }, + [t.CLOSE_SEARCH]: (state, action) => { + state.isOpen = false; }, }); - -// return state = action.result; -// if (typeof state === 'undefined') { -// return initialState; -// } - -// state.search[action.name] = { -// isOpen: true, -// payload: action.payload || {}, -// }; diff --git a/client/src/store/search/search.type.js b/client/src/store/search/search.type.js index 9dc5162e7..e9c47a60f 100644 --- a/client/src/store/search/search.type.js +++ b/client/src/store/search/search.type.js @@ -1,5 +1,5 @@ export default { - SEARCH_SUCCESS: 'SEARCH_SUCCESS', - SEARCH_FAILURE: 'SEARCH_FAILURE', - SEARCH_REQUEST: 'SEARCH_REQUEST', + SEARCH_SUCCESS:'SEARCH_SUCCESS', + OPEN_SEARCH: 'OPEN_SEARCH', + CLOSE_SEARCH: 'CLOSE_SEARCH', }; diff --git a/client/src/style/pages/dashboard.scss b/client/src/style/pages/dashboard.scss index 60bc22c90..ae2570ab8 100644 --- a/client/src/style/pages/dashboard.scss +++ b/client/src/style/pages/dashboard.scss @@ -55,6 +55,7 @@ color: #1552C8; } } + } &-user{ @@ -92,6 +93,11 @@ &:hover{ background: $light-gray2; } + &::before{ + background: escape-svg($breadcrumbs-collapsed-icon) center center; + width: 15px; + height: 15px; + } } } @@ -209,6 +215,7 @@ } } + &__page-content{ // padding: 22px; } @@ -269,4 +276,19 @@ .navbar--dashboard-views{ box-shadow: 0 0 0; border-bottom: 1px solid #EAEAEA; +} +.navbar-omnibar{ + -webkit-filter: blur(0); + filter: blur(0); + opacity: 1; + top: 20vh; + left: calc(50% - 250px); + z-index: 21; + border-radius: 3px; + -webkit-box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), + 0 4px 8px rgba(16, 22, 26, 0.2), 0 18px 46px 6px rgba(16, 22, 26, 0.2); + box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 4px 8px rgba(16, 22, 26, 0.2), + 0 18px 46px 6px rgba(16, 22, 26, 0.2); + background-color: #fff; + width: 500px; } \ No newline at end of file