fix(webapp): localize footer/menu and harden auth routes

This commit is contained in:
Ruslan Bakiev
2026-04-21 11:16:27 +07:00
parent 54aac790ee
commit 84deb2d1bc
6 changed files with 74 additions and 24 deletions

View File

@@ -7,9 +7,9 @@ const props = withDefaults(defineProps<{
const { toLocalized } = useLocalizedNavigation()
const footerLinks = [
{ label: 'Главная', to: '/' },
{ label: 'Заказы', to: '/clientarea/orders' },
{ label: 'Кабинет', to: '/clientarea/profile' },
{ label: 'Home', to: '/' },
{ label: 'Orders', to: '/clientarea/orders' },
{ label: 'Profile', to: '/clientarea/profile' },
]
const socialLinks = [
@@ -37,9 +37,9 @@ const currentYear = new Date().getFullYear()
: 'border-white/20 bg-[rgba(11,24,42,0.26)] [backdrop-filter:blur(6px)]'"
>
<div>
<h2 class="m-0 text-[clamp(1.6rem,3.4vw,2.6rem)] font-black leading-[1.08]">Готовы к следующей поставке?</h2>
<h2 class="m-0 text-[clamp(1.6rem,3.4vw,2.6rem)] font-black leading-[1.08]">Ready for your next shipment?</h2>
<p class="mt-3 max-w-[720px] leading-6 text-white/85">
Получайте предложения в реальном времени, сравнивайте условия и запускайте закупку прямо в Optovia.
Get live offers, compare terms, and launch procurement directly in Optovia.
</p>
</div>
@@ -75,7 +75,7 @@ const currentYear = new Date().getFullYear()
</div>
<div class="mt-4 px-1 text-[0.78rem] text-white/70">
<p>&copy; {{ currentYear }} Optovia. Все права защищены.</p>
<p>&copy; {{ currentYear }} Optovia. All rights reserved.</p>
</div>
</div>
</footer>

View File

@@ -18,16 +18,22 @@ const emit = defineEmits<{
}>()
const route = useRoute()
const { t } = useI18n()
const auth = useAuth()
const { basePath, isBasePathActive, navigateToLocalized, toLocalized } = useLocalizedNavigation()
const { draft: calcDraft, hydrateFromQuery, buildQuery: buildCalcQuery } = useCalcSearchDraft()
const isLandingPage = computed(() => basePath.value === '/')
const isAuthPage = computed(() => basePath.value === '/auth' || route.path === '/sign-in' || basePath.value === '/callback')
const isAuthPage = computed(() =>
basePath.value === '/auth'
|| basePath.value === '/sign-in'
|| basePath.value === '/sign-out'
|| basePath.value === '/callback'
)
const isCalcPage = computed(() => basePath.value.startsWith('/catalog'))
const isManagerStagePage = computed(() => basePath.value.startsWith('/manager'))
const isDarkHeaderScene = computed(() => isLandingPage.value || isManagerStagePage.value)
const isAuthenticated = computed(() => props.isAuthenticated || auth.isAuthenticated.value)
const profileLabel = computed(() => props.profileLabel || (auth.user.value?.id ?? 'Профиль'))
const profileLabel = computed(() => props.profileLabel || (auth.user.value?.id ?? t('ui.profile')))
const showLogistics = computed(() => props.showLogistics || Boolean((auth.user.value as any)?.isAdmin))
const landingSearchScrollY = ref(0)
const landingSearchTopStart = ref(450)
@@ -71,9 +77,16 @@ const showAdminDock = computed(() => Boolean(showLogistics.value) && !isAuthPage
// Fullscreen menu
const isMenuOpen = ref(false)
const menuLinks = computed(() => {
return [
{ label: 'Мои заказы', to: '/clientarea/orders', icon: 'orders' },
const links: Array<{ label: string; to: string; icon: string }> = [
{ label: 'Optovia', to: '/', icon: 'map' },
{ label: t('ui.calculate'), to: '/catalog', icon: 'map' },
]
if (isAuthenticated.value) {
links.push({ label: t('ui.profile'), to: '/clientarea/profile', icon: 'referral' })
}
return links
})
watch(() => route.fullPath, () => {