From cc23cef8f9418ce3f470082fa44abc73d48a6157 Mon Sep 17 00:00:00 2001 From: xds Date: Mon, 27 Oct 2025 22:47:31 +0300 Subject: [PATCH] tg app fix sizes --- src/App.vue | 8 ++++---- src/router/index.ts | 21 +++++++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/App.vue b/src/App.vue index 090cd4f..cae5f34 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,9 +21,9 @@ const isSpaceSelected = computed( ); const menu = [ - { name: "Dashboard", icon: "pi pi-chart-bar", link: "/" }, - { name: "Transactions", icon: "pi pi-cog", link: "/transactions" }, - { name: "Settings", icon: "pi pi-list", link: "/settings" }, + { name: "Dashboard", icon: "pi pi-chart-bar", link: "/", navStack: 'dashboard' }, + { name: "Transactions", icon: "pi pi-cog", link: "/transactions", navStack: 'transactions' }, + { name: "Settings", icon: "pi pi-list", link: "/settings", navStack: 'settings' }, ]; function spaceSelected() { @@ -118,7 +118,7 @@ onBeforeUnmount(() => { :key="item.link" :to="item.link" class="flex w-fit h-full flex-col items-center gap-2 !py-2 !px-4" - :class="route.path == item.link ? 'bg-green-100 rounded-2xl ' : ''" + :class="route.meta.navStack === item.navStack ? 'bg-green-100 rounded-2xl ' : ''" > {{ item.name }} diff --git a/src/router/index.ts b/src/router/index.ts index 35c7f1f..b0ee41e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -41,10 +41,10 @@ export const enum RouteName { } const routes: RouteRecordRaw[] = [ - {path: '/login', name: RouteName.Login, component: LoginPage, meta: {requiresAuth: false}}, - {path: '/', name: RouteName.Dashboard, component: DashboardView, meta: {requiresAuth: true}}, - {path: '/transactions', name: RouteName.TransactionList, component: TransactionList, meta: {requiresAuth: true}}, - {path: '/settings', name: RouteName.SettingsList, component: SettingsList, meta: {requiresAuth: true}}, + {path: '/login', name: RouteName.Login, component: LoginPage, meta: {requiresAuth: false, navStack: 'auth'}}, + {path: '/', name: RouteName.Dashboard, component: DashboardView, meta: {requiresAuth: true, navStack: 'dashboard'}}, + {path: '/transactions', name: RouteName.TransactionList, component: TransactionList, meta: {requiresAuth: true, navStack: 'transactions'}}, + {path: '/settings', name: RouteName.SettingsList, component: SettingsList, meta: {requiresAuth: true, navStack: 'settings'}}, { path: '/categories', name: RouteName.CategoriesList, component: CategoriesList, meta: { requiresAuth: true, @@ -57,6 +57,7 @@ const routes: RouteRecordRaw[] = [ }, {id: 'openCategoryCreation', text: '', icon: 'pi pi-plus', onClickId: 'openCategoryCreation'}, ], + navStack: 'settings', } }, { @@ -71,6 +72,7 @@ const routes: RouteRecordRaw[] = [ }, {id: 'createCategory', text: '', icon: 'pi pi-save', onClickId: 'createCategory'}, ], + navStack: 'settings', } }, { @@ -86,7 +88,9 @@ const routes: RouteRecordRaw[] = [ {id: 'deleteCategory', text: '', icon: 'pi pi-trash', onClickId: 'deleteCategory'}, {id: 'updateCategory', text: '', icon: 'pi pi-save', onClickId: 'updateCategory'}, ], + navStack: 'settings', } + }, { @@ -100,7 +104,8 @@ const routes: RouteRecordRaw[] = [ onClickId: 'openSpacePicker', }, {id: 'openRecurrentCreation', text: '', icon: 'pi pi-plus', onClickId: 'openRecurrentCreation'}, - ] + ], + navStack: 'settings', }, }, { @@ -115,6 +120,7 @@ const routes: RouteRecordRaw[] = [ }, {id: 'createRecurrent', text: '', icon: 'pi pi-save', onClickId: 'createCategory'}, ], + navStack: 'settings', } }, { @@ -130,6 +136,7 @@ const routes: RouteRecordRaw[] = [ {id: 'deleteRecurrent', text: '', icon: 'pi pi-trash', onClickId: 'deleteRecurrent'}, {id: 'updateRecurrent', text: '', icon: 'pi pi-save', onClickId: 'updateRecurrent'}, ], + navStack: 'settings', } }, { @@ -147,13 +154,15 @@ const routes: RouteRecordRaw[] = [ }, {id: 'save', text: 'Save', icon: 'pi pi-check', onClickId: 'saveSettings'}, ], + navStack: 'settings', }, }, { path: '/notification-settings', name: RouteName.NotificationSettings, component: NotificationSettings, - meta: {requiresAuth: true} + meta: {requiresAuth: true, + navStack: 'settings',} }, ]