Move layout store to ui

This commit is contained in:
Lucas Verney 2017-09-22 03:07:34 +02:00
parent a620ee62c6
commit 420eac78dd
3 changed files with 7 additions and 6 deletions

View File

@ -20,10 +20,10 @@ export default {
},
computed: {
title() {
return this.$store.getters.layout.title;
return this.$store.getters.ui.title;
},
backgroundColor() {
return this.$store.getters.layout.backgroundColor;
return this.$store.getters.ui.backgroundColor;
},
},
data() {

View File

@ -1,5 +1,6 @@
// TODO: Shouldn't we use mapState/mapGetters?
export default {
product: state => state.product,
isLoading: state => state.isLoading,
layout: state => state.layout,
ui: state => state.ui,
};

View File

@ -4,7 +4,7 @@ import * as types from './mutations-types';
export const initialState = {
product: null,
isLoading: false,
layout: {
ui: {
title: constants.APP_NAME,
backgroundColor: constants.APP_DEFAULT_BACKGROUND_COLOR,
},
@ -19,9 +19,9 @@ export const mutations = {
state.isLoading = true;
},
[types.SET_TITLE](state, { title }) {
state.layout.title = title;
state.ui.title = title;
},
[types.SET_BACKGROUND_COLOR](state, { backgroundColor }) {
state.layout.backgroundColor = backgroundColor;
state.ui.backgroundColor = backgroundColor;
},
};