-
+
+
+
+
@@ -8,10 +10,13 @@
import {onMounted} from "vue";
import {useRoute} from "vue-router";
import {useUserActivation} from "@/composables/user";
-import DepositForm from "@/components/forms/deposit-form.vue";
-import LoginForm from "@/components/forms/login-form.vue";
+import {useAppStore} from "@/stores/app.js";
+import HomeHero from "@/components/home/home-hero.vue";
+import HomeCollection from "@/components/home/home-collection.vue";
+import HomeBrands from "@/components/home/home-brands.vue";
const route = useRoute()
+const appStore = useAppStore()
const { activateUser } = useUserActivation();
@@ -19,9 +24,17 @@ onMounted( async () => {
if (route.name === "activate-user") {
await activateUser()
}
+
+ if (route.name === "reset-password") {
+ await appStore.setActiveState('new-password')
+ }
})
\ No newline at end of file
diff --git a/storefront/src/pages/product-page.vue b/storefront/src/pages/product-page.vue
index 1dc7755b..02dd8e44 100644
--- a/storefront/src/pages/product-page.vue
+++ b/storefront/src/pages/product-page.vue
@@ -11,7 +11,7 @@
+
+
\ No newline at end of file
diff --git a/storefront/src/pages/store-page.vue b/storefront/src/pages/store-page.vue
index 9171d8b4..ae5d21b7 100644
--- a/storefront/src/pages/store-page.vue
+++ b/storefront/src/pages/store-page.vue
@@ -16,8 +16,6 @@ const { products, pageInfo, loading, getProducts } = useProducts();
onMounted(async () => {
await getProducts({})
- console.log('products:', products)
- console.log('pageInfo:', pageInfo)
})
diff --git a/storefront/src/pages/wishlist-page.vue b/storefront/src/pages/wishlist-page.vue
new file mode 100644
index 00000000..8fc85980
--- /dev/null
+++ b/storefront/src/pages/wishlist-page.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/storefront/src/router/index.js b/storefront/src/router/index.js
index 171cdc2e..a31d1e8f 100644
--- a/storefront/src/router/index.js
+++ b/storefront/src/router/index.js
@@ -6,12 +6,15 @@ import NewPasswordForm from "@/components/forms/new-password-form.vue";
import BlogPage from "@/pages/blog-page.vue";
import PostPage from "@/pages/post-page.vue";
import ProfilePage from "@/pages/profile-page.vue";
-import {useAuthStore} from "@/stores/auth.js";
+import {useUserStore} from "@/stores/user.js";
import RegisterForm from "@/components/forms/register-form.vue";
import LoginForm from "@/components/forms/login-form.vue";
import ResetPasswordForm from "@/components/forms/reset-password-form.vue";
import StorePage from "@/pages/store-page.vue";
import ProductPage from "@/pages/product-page.vue";
+import SearchPage from "@/pages/search-page.vue";
+import CartPage from "@/pages/cart-page.vue";
+import WishlistPage from "@/pages/wishlist-page.vue";
const routes = [
{
@@ -35,41 +38,6 @@ const routes = [
title: 'Home'
}
},
- {
- path: 'reset-password',
- name: 'reset-password',
- component: NewPasswordForm,
- meta: {
- title: 'New Password'
- }
- },
- {
- path: 'register',
- name: 'register',
- component: RegisterForm,
- meta: {
- title: 'Register',
- requiresGuest: true
- }
- },
- {
- path: 'login',
- name: 'login',
- component: LoginForm,
- meta: {
- title: 'Login',
- requiresGuest: true
- }
- },
- {
- path: 'forgot-password',
- name: 'forgot-password',
- component: ResetPasswordForm,
- meta: {
- title: 'Forgot Password',
- requiresGuest: true
- }
- },
{
path: 'blog',
name: 'blog',
@@ -102,6 +70,30 @@ const routes = [
title: 'Product'
}
},
+ {
+ path: 'search',
+ name: 'search',
+ component: SearchPage,
+ meta: {
+ title: 'Search'
+ }
+ },
+ {
+ path: 'cart',
+ name: 'cart',
+ component: CartPage,
+ meta: {
+ title: 'Cart'
+ }
+ },
+ {
+ path: 'wishlist',
+ name: 'wishlist',
+ component: WishlistPage,
+ meta: {
+ title: 'Wishlist'
+ }
+ },
{
path: 'profile',
name: 'profile',
@@ -129,8 +121,8 @@ const router = createRouter({
})
router.beforeEach((to, from, next) => {
- const authStore = useAuthStore();
- const isAuthenticated = authStore.accessToken
+ const userStore = useUserStore();
+ const isAuthenticated = userStore.accessToken
document.title = to.meta.title ? `${APP_NAME} | ` + to.meta?.title : APP_NAME
diff --git a/storefront/src/stores/app.js b/storefront/src/stores/app.js
new file mode 100644
index 00000000..909c35b1
--- /dev/null
+++ b/storefront/src/stores/app.js
@@ -0,0 +1,25 @@
+import { defineStore } from "pinia";
+import { ref, computed } from "vue";
+
+export const useAppStore = defineStore('app', () => {
+ const activeState = ref(null);
+
+ const setActiveState = (state) => {
+ activeState.value = state;
+ };
+
+ const isSignUp = computed(() => activeState.value === "signUp");
+ const isSignIn = computed(() => activeState.value === "signIn");
+ const isForgot = computed(() => activeState.value === "reset-password");
+ const isReset = computed(() => activeState.value === "new-password");
+
+ return {
+ activeState,
+ setActiveState,
+
+ isSignUp,
+ isSignIn,
+ isForgot,
+ isReset
+ };
+});
\ No newline at end of file
diff --git a/storefront/src/stores/auth.js b/storefront/src/stores/auth.js
deleted file mode 100644
index bc7e5c69..00000000
--- a/storefront/src/stores/auth.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import {defineStore} from "pinia";
-import {ref} from "vue";
-
-export const useAuthStore = defineStore('auth', () => {
- const user = ref(null);
- const accessToken = ref(null);
-
- const setUser = (payload) => {
- user.value = payload.user
- accessToken.value = payload.accessToken
- }
-
- return { user, accessToken, setUser }
-})
\ No newline at end of file
diff --git a/storefront/src/stores/languages.js b/storefront/src/stores/languages.js
index 066dcf10..282adeed 100644
--- a/storefront/src/stores/languages.js
+++ b/storefront/src/stores/languages.js
@@ -7,8 +7,15 @@ export const useLanguageStore = defineStore('language', () => {
languages.value = payload
};
+ const currentLocale = ref(null);
+ const setCurrentLocale = (payload) => {
+ currentLocale.value = payload
+ };
+
return {
languages,
- setLanguages
+ setLanguages,
+ currentLocale,
+ setCurrentLocale
}
})
diff --git a/storefront/src/stores/user.js b/storefront/src/stores/user.js
new file mode 100644
index 00000000..aac6ef56
--- /dev/null
+++ b/storefront/src/stores/user.js
@@ -0,0 +1,12 @@
+import {defineStore} from "pinia";
+import {ref} from "vue";
+
+export const useUserStore = defineStore('user', () => {
+ const user = ref(null);
+
+ const setUser = (payload) => {
+ user.value = payload.user
+ }
+
+ return { user, setUser }
+})
\ No newline at end of file