diff --git a/src/@core/layouts/components/layout-wrapper/index.js b/src/@core/layouts/components/layout-wrapper/index.js index 02f2f358..db3e0025 100644 --- a/src/@core/layouts/components/layout-wrapper/index.js +++ b/src/@core/layouts/components/layout-wrapper/index.js @@ -23,7 +23,7 @@ const LayoutWrapper = props => { // ** Store Vars const dispatch = useDispatch(); const store = useSelector(state => state); - const navbarStore = store.navbar; + // const navbarStore = store.navbar; const contentWidth = store.layoutState.contentWidth; //** Vars @@ -64,7 +64,7 @@ const LayoutWrapper = props => {
diff --git a/src/redux/actions/navbar/Index.js b/src/redux/actions/navbar/Index.js deleted file mode 100644 index 800b3449..00000000 --- a/src/redux/actions/navbar/Index.js +++ /dev/null @@ -1,26 +0,0 @@ -import axios from 'axios' - -// ** Get Bookmarks Array from @fakeDB -export const getBookmarks = () => { - return dispatch => { - return axios.get('/api/bookmarks/data').then(response => { - dispatch({ - type: 'GET_BOOKMARKS', - data: response.data.suggestions, - bookmarks: response.data.bookmarks - }) - }) - } -} - -// ** Update & Get Updated Bookmarks Array -export const updateBookmarked = id => { - return dispatch => { - return axios.post('/api/bookmarks/update', { id }).then(() => { - dispatch({ type: 'UPDATE_BOOKMARKED', id }) - }) - } -} - -// ** Handle Bookmarks & Main Search Queries -export const handleSearchQuery = val => dispatch => dispatch({ type: 'HANDLE_SEARCH_QUERY', val }) diff --git a/src/redux/reducers/navbar/index.js b/src/redux/reducers/navbar/index.js deleted file mode 100644 index 13220107..00000000 --- a/src/redux/reducers/navbar/index.js +++ /dev/null @@ -1,45 +0,0 @@ -// ** Initial State -const initialState = { - suggestions: [], - bookmarks: [], - query: '', - headerMenu: 'basis' -}; - -const navbarReducer = (state = initialState, action) => { - switch (action.type) { - case 'HANDLE_SEARCH_QUERY': - return { ...state, query: action.val }; - case 'GET_BOOKMARKS': - return { - ...state, - suggestions: action.data, - bookmarks: action.bookmarks - }; - case 'UPDATE_BOOKMARKED': - let objectToUpdate; - - // ** find & update object - state.suggestions.find(item => { - if (item.id === action.id) { - item.isBookmarked = !item.isBookmarked; - objectToUpdate = item; - } - }); - case 'CLICK_HEADER_MENU': - // ** Get index to add or remove bookmark from array - const bookmarkIndex = state.bookmarks.findIndex(x => x.id === action.id); - - if (bookmarkIndex === -1) { - state.bookmarks.push(objectToUpdate); - } else { - state.bookmarks.splice(bookmarkIndex, 1); - } - - return { ...state }; - default: - return state; - } -}; - -export default navbarReducer; diff --git a/src/redux/reducers/rootReducer.ts b/src/redux/reducers/rootReducer.ts index efc6d4a3..460638d5 100644 --- a/src/redux/reducers/rootReducer.ts +++ b/src/redux/reducers/rootReducer.ts @@ -3,8 +3,6 @@ import { combineReducers } from 'redux'; import { all, fork } from 'redux-saga/effects'; // ** Reducers, Sagas Imports -import navbar from './navbar'; - import { findSaga, findReducer } from '../../modules/account/find'; import { authSaga, @@ -59,7 +57,6 @@ export function* saga() { } const rootReducer = combineReducers({ - navbar, controlMapReducer, mainDashState: mainDahReducer, messageState: messageReducer,