From 8b0e1900d16968f9d2932f3d90129e7a76a42f29 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Wed, 28 Jan 2026 05:28:16 +0700 Subject: [PATCH] feat(nav): client area tabs in main navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Cabinet button to header (dashboard icon) - When in /clientarea/* show tabs instead of search input - Tabs: Заказы | Предложения (SELLER only) | Адреса | Профиль | Команда - Hide Explore/Quote toggle in client area - Remove SubNavigation for clientarea (tabs moved to MainNavigation) --- app/components/navigation/MainNavigation.vue | 73 ++++++++++++++++++-- app/layouts/topnav.vue | 13 +++- i18n/locales/en/cabinetNav.json | 1 + i18n/locales/ru/cabinetNav.json | 1 + 4 files changed, 80 insertions(+), 8 deletions(-) diff --git a/app/components/navigation/MainNavigation.vue b/app/components/navigation/MainNavigation.vue index 6c5d834..33ed4ff 100644 --- a/app/components/navigation/MainNavigation.vue +++ b/app/components/navigation/MainNavigation.vue @@ -12,8 +12,8 @@ Optovia - - + + + + + + + {{ $t('cabinetNav.orders') }} + + + {{ $t('cabinetNav.myOffers') }} + + + {{ $t('cabinetNav.addresses') }} + + + {{ $t('cabinetNav.profile') }} + + + {{ $t('cabinetNav.team') }} + + + + - + - + + + + + + (), { @@ -334,10 +389,18 @@ defineEmits([ ]) const localePath = useLocalePath() +const route = useRoute() const { locale, locales } = useI18n() const switchLocalePath = useSwitchLocalePath() const { t } = useI18n() +// Check if client area tab is active +const isClientAreaTabActive = (path: string) => { + const currentPath = route.path + const localizedPath = localePath(path) + return currentPath === localizedPath || currentPath.startsWith(localizedPath + '/') +} + const inputRef = ref() const localSearchQuery = ref(props.searchQuery || '') const localQuantity = ref(props.quantity || '') diff --git a/app/layouts/topnav.vue b/app/layouts/topnav.vue index 9f01fcc..cb602ef 100644 --- a/app/layouts/topnav.vue +++ b/app/layouts/topnav.vue @@ -30,6 +30,7 @@ :show-active-mode="isCatalogSection" :is-collapsed="isHomePage ? heroIsCollapsed : isCatalogSection" :is-home-page="isHomePage" + :is-client-area="isClientArea" @toggle-theme="toggleTheme" @set-catalog-mode="setCatalogMode" @sign-out="onClickSignOut" @@ -54,9 +55,9 @@ - + @@ -174,8 +175,13 @@ const isCatalogSection = computed(() => { route.path.startsWith('/ru/catalog') }) +// Client area detection (cabinet tabs in MainNavigation, no SubNav needed) +const isClientArea = computed(() => { + return route.path.includes('/clientarea') +}) + // Collapsible header logic - only for pages with SubNav -const hasSubNav = computed(() => !isHomePage.value && !isCatalogSection.value) +const hasSubNav = computed(() => !isHomePage.value && !isCatalogSection.value && !isClientArea.value) const canCollapse = computed(() => hasSubNav.value) const isHeaderCollapsed = computed(() => canCollapse.value && isCollapsed.value) @@ -193,6 +199,7 @@ const headerContainerStyle = computed(() => { const mainStyle = computed(() => { if (isCatalogSection.value) return { paddingTop: '0' } if (isHomePage.value) return { paddingTop: `${heroBaseHeight.value}px` } + if (isClientArea.value) return { paddingTop: '116px' } // Header only, no SubNav return { paddingTop: '154px' } }) diff --git a/i18n/locales/en/cabinetNav.json b/i18n/locales/en/cabinetNav.json index dc98cc3..d2e3df6 100644 --- a/i18n/locales/en/cabinetNav.json +++ b/i18n/locales/en/cabinetNav.json @@ -1,5 +1,6 @@ { "cabinetNav": { + "cabinet": "My Cabinet", "search": "Search", "catalog": "Catalog", "orders": "My orders", diff --git a/i18n/locales/ru/cabinetNav.json b/i18n/locales/ru/cabinetNav.json index c5a9f28..c9f667f 100644 --- a/i18n/locales/ru/cabinetNav.json +++ b/i18n/locales/ru/cabinetNav.json @@ -1,5 +1,6 @@ { "cabinetNav": { + "cabinet": "Мой кабинет", "search": "Поиск", "catalog": "Каталог", "orders": "Мои заказы",