From 2ad4085c9db53301e616b9c94d37b2d2681109c4 Mon Sep 17 00:00:00 2001 From: hayden Date: Wed, 27 Jan 2021 20:04:56 -0900 Subject: [PATCH] frontend category placeholder --- frontend/src/App.vue | 1 + .../Settings/General/HomePageSettings.vue | 144 ++++++++++++++++++ .../src/components/Settings/General/index.vue | 70 +-------- frontend/src/components/UI/CardSection.vue | 21 ++- frontend/src/pages/HomePage.vue | 27 +++- frontend/src/store/modules/recipes.js | 1 - frontend/src/store/store.js | 18 ++- 7 files changed, 200 insertions(+), 82 deletions(-) create mode 100644 frontend/src/components/Settings/General/HomePageSettings.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index f03cf1cbe..8c043cbb6 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -58,6 +58,7 @@ export default { mounted() { this.$store.dispatch("initTheme"); this.$store.dispatch("requestRecentRecipes"); + this.$store.dispatch("requestHomePageSettings"); this.$store.dispatch("initLang"); this.darkModeSystemCheck(); this.darkModeAddEventListener(); diff --git a/frontend/src/components/Settings/General/HomePageSettings.vue b/frontend/src/components/Settings/General/HomePageSettings.vue new file mode 100644 index 000000000..2253be8bf --- /dev/null +++ b/frontend/src/components/Settings/General/HomePageSettings.vue @@ -0,0 +1,144 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/Settings/General/index.vue b/frontend/src/components/Settings/General/index.vue index 226932c92..e9261da55 100644 --- a/frontend/src/components/Settings/General/index.vue +++ b/frontend/src/components/Settings/General/index.vue @@ -4,76 +4,14 @@ General Settings - + mdi-link Local API - -

Home Page

- - -
- - - - - -

Homepage Categories

-
- - - - - - - mdi-menu - - - - - - - - - -
-
- - - -

All Categories

-
- - - - - - - mdi-menu - - - - - - - - - -
-
-
-
+

Language

@@ -97,11 +35,11 @@ diff --git a/frontend/src/store/modules/recipes.js b/frontend/src/store/modules/recipes.js index 3410062ba..e69de29bb 100644 --- a/frontend/src/store/modules/recipes.js +++ b/frontend/src/store/modules/recipes.js @@ -1 +0,0 @@ -c \ No newline at end of file diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 37683e023..55391250f 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -19,10 +19,11 @@ const store = new Vuex.Store({ }, state: { // Home Page Settings - homePage: { + homePageSettings: { showRecent: true, showLimit: 9, categories: [], + homeCategories: [], }, // Snackbar snackActive: false, @@ -35,8 +36,8 @@ const store = new Vuex.Store({ }, mutations: { - setHomePage(state, payload) { - state.homePage = payload; + setHomePageSettings(state, payload) { + state.homePageSettings = payload; }, setSnackBar(state, payload) { state.snackText = payload.text; @@ -66,6 +67,15 @@ const store = new Vuex.Store({ this.commit("setRecentRecipes", payload); }, + + async requestHomePageSettings() { + // TODO: Query Backend for Categories + // this.commit("setHomePage", { + // showRecent: true, + // showLimit: 9, + // categories: ["breakfast", "lunch", "dinner"], + // }); + }, }, getters: { @@ -75,7 +85,7 @@ const store = new Vuex.Store({ getSnackType: (state) => state.snackType, getRecentRecipes: (state) => state.recentRecipes, - getHomePageSettings: (state) => state.homePage, + getHomePageSettings: (state) => state.homePageSettings, }, });