Update widget colors based on the widgetConfig (#276)

This commit is contained in:
Pranav Raj S
2019-11-26 00:10:27 +05:30
committed by Sojan Jose
parent 9c6a101768
commit 5d2efdc7fc
11 changed files with 85 additions and 21 deletions

View File

@@ -0,0 +1,29 @@
import { SET_WIDGET_COLOR } from '../types';
const state = {
widgetColor: '',
};
const getters = {
getWidgetColor: $state => $state.widgetColor,
};
const actions = {
setWidgetColor({ commit }, data) {
commit(SET_WIDGET_COLOR, data);
},
};
const mutations = {
[SET_WIDGET_COLOR]($state, data) {
$state.widgetColor = data.widget_color;
},
};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
};