2026-09-09 06:46:27 +03:30
|
|
|
<!--
|
|
|
|
|
Ported from legacy henza_pwa/src/App.vue — layout switching, RTL shell, and
|
2026-10-10 12:44:24 +03:30
|
|
|
and the update gate (components/AppUpdateGate.vue).
|
2026-09-09 06:46:27 +03:30
|
|
|
|
|
|
|
|
Not ported (deliberate): Firebase push init and WebOTP autofill. Both were
|
|
|
|
|
already commented out in legacy's own App.vue, so neither ran there either.
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
2026-10-12 11:48:59 +03:30
|
|
|
<div :class="{ 'is-actingAs': Boolean(session.actingAs) }">
|
|
|
|
|
<ActingAsBar />
|
2026-09-09 06:46:27 +03:30
|
|
|
<component :is="getLayout" class="relative">
|
|
|
|
|
<router-view v-slot="{ Component, route }">
|
|
|
|
|
<keep-alive>
|
|
|
|
|
<suspense>
|
|
|
|
|
<template #default>
|
|
|
|
|
<component :is="Component" :key="route.name" />
|
|
|
|
|
</template>
|
|
|
|
|
</suspense>
|
|
|
|
|
</keep-alive>
|
|
|
|
|
</router-view>
|
|
|
|
|
</component>
|
|
|
|
|
|
2026-10-10 12:44:24 +03:30
|
|
|
<AppUpdateGate />
|
2026-10-27 16:40:54 +03:30
|
|
|
<InstallPromptModal />
|
2026-10-04 13:57:25 +03:30
|
|
|
|
2026-10-04 16:18:56 +03:30
|
|
|
<ProductMorph />
|
2026-10-04 13:57:25 +03:30
|
|
|
<ToastHost />
|
2026-09-09 06:46:27 +03:30
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-10-10 12:44:24 +03:30
|
|
|
import { computed } from 'vue'
|
2026-09-09 06:46:27 +03:30
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { useRegisterSW } from 'virtual:pwa-register/vue'
|
|
|
|
|
import MasterLayout from './layout/MasterLayout.vue'
|
|
|
|
|
import FullPageLayout from './layout/FullPageLayout.vue'
|
2026-10-10 12:44:24 +03:30
|
|
|
import AppUpdateGate from './components/AppUpdateGate.vue'
|
2026-10-27 16:40:54 +03:30
|
|
|
import InstallPromptModal from './components/pwa/InstallPromptModal.vue'
|
2026-10-04 13:57:25 +03:30
|
|
|
import ToastHost from './components/ui/ToastHost.vue'
|
2026-10-04 16:18:56 +03:30
|
|
|
import ProductMorph from './components/product/ProductMorph.vue'
|
2026-10-12 11:48:59 +03:30
|
|
|
import ActingAsBar from './components/expert/ActingAsBar.vue'
|
|
|
|
|
import { useSessionStore } from './stores/session'
|
2026-10-27 16:40:54 +03:30
|
|
|
import { usePwaInstall } from './composables/usePwaInstall'
|
2026-09-09 06:46:27 +03:30
|
|
|
|
|
|
|
|
const router = useRouter()
|
2026-10-12 11:48:59 +03:30
|
|
|
const session = useSessionStore()
|
2026-10-10 12:44:24 +03:30
|
|
|
// Registers the service worker (offline, install). Updates are not applied
|
|
|
|
|
// here: AppUpdateGate shows what changed and applies them on the user's tap.
|
|
|
|
|
useRegisterSW()
|
2026-10-27 16:40:54 +03:30
|
|
|
usePwaInstall().start(router)
|
2026-09-09 06:46:27 +03:30
|
|
|
|
|
|
|
|
const getLayout = computed(() => {
|
|
|
|
|
if (router.currentRoute.value.meta && router.currentRoute.value.meta.layout === 'FullPage') {
|
|
|
|
|
return FullPageLayout
|
|
|
|
|
}
|
|
|
|
|
return MasterLayout
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
|
body::-webkit-scrollbar {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-12 11:48:59 +03:30
|
|
|
/* The act-as strip is fixed, so push everything down by its height while it is
|
|
|
|
|
up — otherwise it covers the top of each page, including sticky headers. */
|
|
|
|
|
.is-actingAs {
|
2026-10-26 11:16:23 +03:30
|
|
|
/* The strip's height. Fixed headers read it as their `top`, and the page flow
|
|
|
|
|
is pushed down by the same amount. */
|
|
|
|
|
--aab-h: 38px;
|
|
|
|
|
padding-top: var(--aab-h);
|
2026-10-12 11:48:59 +03:30
|
|
|
}
|
|
|
|
|
|
2026-09-09 06:46:27 +03:30
|
|
|
#app {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
direction: rtl !important;
|
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
|
|
text-align: start;
|
|
|
|
|
color: @primary;
|
|
|
|
|
-webkit-user-select: none;
|
|
|
|
|
-ms-user-select: none;
|
|
|
|
|
user-select: none;
|
2026-10-28 14:29:12 +03:30
|
|
|
// Centred phone column on desktop (width only). Do NOT put transform /
|
|
|
|
|
// filter / perspective here — that would make position:fixed bars
|
|
|
|
|
// (tabbar, PageBar) stick to #app and scroll away with the page.
|
|
|
|
|
max-width: var(--app-max-width);
|
|
|
|
|
margin-inline: auto;
|
|
|
|
|
min-height: 100dvh;
|
|
|
|
|
min-height: 100svh;
|
|
|
|
|
background: @page;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (min-width: 431px) {
|
|
|
|
|
#app {
|
|
|
|
|
box-shadow:
|
|
|
|
|
0 0 0 1px @hairline,
|
|
|
|
|
0 28px 64px -28px rgba(20, 22, 26, 0.32);
|
|
|
|
|
}
|
2026-09-09 06:46:27 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.slideDown-enter-active,
|
|
|
|
|
.slideDown-leave-active {
|
|
|
|
|
transition: all @transition-duration ease;
|
|
|
|
|
}
|
|
|
|
|
.slideDown-enter-from {
|
|
|
|
|
transform: translateY(-100vh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.slideDown-leave-to {
|
|
|
|
|
transform: translateY(100vh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.slideDown-leave-from {
|
|
|
|
|
transform: translateY(0);
|
|
|
|
|
}
|
|
|
|
|
.slideDown-enter-to {
|
|
|
|
|
transform: translateY(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.fade-down-enter-active,
|
|
|
|
|
.fade-down-leave-active {
|
|
|
|
|
transition: all @transition-duration ease;
|
|
|
|
|
}
|
|
|
|
|
</style>
|