diff --git a/frontend/src/components/Settings/General/index.vue b/frontend/src/components/Settings/General/index.vue index 3e3ac3cef..3d44f5854 100644 --- a/frontend/src/components/Settings/General/index.vue +++ b/frontend/src/components/Settings/General/index.vue @@ -3,6 +3,19 @@ General Settings +

Home Page

+ + Section Selector + + + + + + +
+ + +

Language

+ diff --git a/frontend/src/components/UI/CardSection.vue b/frontend/src/components/UI/CardSection.vue index 307647ce3..16bf6ce55 100644 --- a/frontend/src/components/UI/CardSection.vue +++ b/frontend/src/components/UI/CardSection.vue @@ -50,11 +50,12 @@ export default { props: { title: String, recipes: Array, + cardLimit: { + default: 6, + }, }, data() { - return { - cardLimit: 6, - }; + return {}; }, }; diff --git a/frontend/src/pages/HomePage.vue b/frontend/src/pages/HomePage.vue index 07ba573bc..521d73721 100644 --- a/frontend/src/pages/HomePage.vue +++ b/frontend/src/pages/HomePage.vue @@ -1,11 +1,16 @@ @@ -18,7 +23,6 @@ export default { }, data() { return { - showRecent: true, recipeByCategory: [ { title: "Title 1", @@ -35,6 +39,9 @@ export default { recentRecipes() { return this.$store.getters.getRecentRecipes; }, + pageSettings() { + return this.$store.getters.getHomePageSettings; + }, }, methods: { getRecentRecipes() { diff --git a/frontend/src/store/modules/recipes.js b/frontend/src/store/modules/recipes.js new file mode 100644 index 000000000..3410062ba --- /dev/null +++ b/frontend/src/store/modules/recipes.js @@ -0,0 +1 @@ +c \ No newline at end of file diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 2c0448fad..37683e023 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -18,6 +18,12 @@ const store = new Vuex.Store({ language, }, state: { + // Home Page Settings + homePage: { + showRecent: true, + showLimit: 9, + categories: [], + }, // Snackbar snackActive: false, snackText: "", @@ -29,6 +35,9 @@ const store = new Vuex.Store({ }, mutations: { + setHomePage(state, payload) { + state.homePage = payload; + }, setSnackBar(state, payload) { state.snackText = payload.text; state.snackType = payload.type; @@ -61,11 +70,12 @@ const store = new Vuex.Store({ getters: { // - getSnackText: state => state.snackText, - getSnackActive: state => state.snackActive, - getSnackType: state => state.snackType, + getSnackText: (state) => state.snackText, + getSnackActive: (state) => state.snackActive, + getSnackType: (state) => state.snackType, - getRecentRecipes: state => state.recentRecipes, + getRecentRecipes: (state) => state.recentRecipes, + getHomePageSettings: (state) => state.homePage, }, });