Show banner when in edit mode

This commit is contained in:
Alicia Sykes
2021-10-17 19:14:12 +01:00
parent 5aefbb272f
commit 159748e3de
5 changed files with 39 additions and 0 deletions

View File

@@ -13,12 +13,14 @@ const {
SET_MODAL_OPEN,
SET_LANGUAGE,
UPDATE_ITEM,
SET_EDIT_MODE,
} = Keys;
const store = new Vuex.Store({
state: {
config: {},
lang: '', // The users language, auto-detected or read from local storage / config
editMode: false, // While true, the user can drag and edit items + sections
modalOpen: false, // KB shortcut functionality will be disabled when modal is open
},
getters: {
@@ -59,6 +61,9 @@ const store = new Vuex.Store({
[SET_MODAL_OPEN](state, modalOpen) {
state.modalOpen = modalOpen;
},
[SET_EDIT_MODE](state, editMode) {
state.editMode = editMode;
},
[UPDATE_ITEM](state, payload) {
const { itemId, newItem } = payload;
const newConfig = state.config;