- Fix silent redirect-to-home for unauthenticated users on protected routes; now redirects to login with a return path - Restyle OrderCard, SearchInput, Filters, DropDown, and product card image sizing/centering to match the app's LESS-token design language - Fix ant-design Slider handle placement/drag under RTL and seed a valid default range so handles actually render - Fix chip-row edge padding and top spacing across Orders/Cart/Search lists - Add pull-to-refresh to the dashboard and fix its header/padding to match the fixed PageBar pattern - Remove the floating WhatsApp button from index.html
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
// Ported from legacy henza_pwa/src/store/navStore.ts (a hand-rolled reactive
|
|
// class) to a real Pinia store, preserving the same state shape and setter
|
|
// behavior. The route list itself was redesigned to a 5-tab bottom nav
|
|
// (Home, Search, Cart, Orders, Profile) — see components/ui/Navigation.vue.
|
|
import { defineStore } from 'pinia'
|
|
|
|
interface NavItem {
|
|
name: string
|
|
path: string
|
|
icon: string
|
|
label: string
|
|
index: number
|
|
}
|
|
|
|
interface NavState {
|
|
navBarRoutes: NavItem[]
|
|
activeLink: number
|
|
showNav: boolean
|
|
// legacy passes `undefined` to clear the transition (router/index.ts:270)
|
|
pageTransition: string | undefined
|
|
}
|
|
|
|
export const useNavStore = defineStore('nav', {
|
|
state: (): NavState => ({
|
|
navBarRoutes: [
|
|
{ name: 'home', path: '/home', icon: 'vuesax-linear:home-2', label: 'خانه', index: 1 },
|
|
{ name: 'search', path: '/search', icon: 'vuesax-linear:search-normal-1', label: 'جستجو', index: 2 },
|
|
{ name: 'cart', path: '/cart', icon: 'vuesax-linear:bag-happy', label: 'سبد خرید', index: 3 },
|
|
{ name: 'ordersList', path: '/orders', icon: 'vuesax-linear:receipt-text', label: 'سفارشات', index: 4 },
|
|
{ name: 'userPage::hasSubRoute', path: '/user', icon: 'vuesax-linear:user', label: 'پروفایل', index: 5 },
|
|
],
|
|
activeLink: 1,
|
|
showNav: true,
|
|
pageTransition: 'right',
|
|
}),
|
|
actions: {
|
|
setNavVisibility(data: boolean) {
|
|
this.showNav = data
|
|
},
|
|
setActiveLink(activeLink: number) {
|
|
this.activeLink = activeLink
|
|
},
|
|
setPgaTransition(transition: string | undefined) {
|
|
this.pageTransition = transition
|
|
},
|
|
},
|
|
})
|