Update widget colors based on the widgetConfig (#276)
This commit is contained in:
29
app/javascript/widget/store/modules/appConfig.js
Normal file
29
app/javascript/widget/store/modules/appConfig.js
Normal 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,
|
||||
};
|
||||
Reference in New Issue
Block a user