Skip to content

Commit

Permalink
feat: create tag collections menu logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Sep 5, 2020
1 parent 4b55628 commit d54c1d3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions store/navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const state = () => ({
isActive: false,

negativeTags: { isActive: false },
tagCollections: { isActive: false },
},
})

Expand All @@ -23,6 +24,9 @@ export const getters = {
return state.search.negativeTags.isActive
},

isTagCollectionsActive(state) {
return state.search.tagCollections.isActive
},
}

export const mutations = {
Expand All @@ -38,6 +42,11 @@ export const mutations = {
state.search.negativeTags.isActive = value
},

setSearchTagCollectionsIsActive(state, value) {
state.search.tagCollections.isActive = value
},
}

export const actions = {
sideNavNavigationManager({ commit, getters }, { operation, value }) {
switch (operation) {
Expand Down Expand Up @@ -84,4 +93,21 @@ export const actions = {
}
},

tagCollectionsNavigationManager({ commit, getters }, { operation, value }) {
switch (operation) {
case 'toggle':
commit(
'setSearchTagCollectionsIsActive',
!getters.isTagCollectionsActive
)
break

case 'set':
commit('setSearchTagCollectionsIsActive', value)
break

default:
throw new Error('No operation specified')
}
},
}

0 comments on commit d54c1d3

Please sign in to comment.