From 420eac78dd2d6136b02c55c3d5b93a14890fbb6c Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Fri, 22 Sep 2017 03:07:34 +0200 Subject: [PATCH] Move layout store to ui --- src/App.vue | 4 ++-- src/store/getters.js | 3 ++- src/store/mutations.js | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index e7a83d7..1e1987b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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() { diff --git a/src/store/getters.js b/src/store/getters.js index 5f58f6b..4921669 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -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, }; diff --git a/src/store/mutations.js b/src/store/mutations.js index e1dbc32..39d7cec 100644 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -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; }, };