|
1 | 1 | <template> |
2 | | - <div class="flex flex-col md:flex-row h-full"> |
3 | | - <AppSidebar v-if="!isSignupFlow && !isHideSidebar && $session.user && $team?.doc && route.name !== 'Login'" /> |
| 2 | + <div class="flex flex-col md:flex-row h-full"> |
| 3 | + <AppSidebar |
| 4 | + v-if="!isSignupFlow && !isHideSidebar && $session.user && $team?.doc && route.name !== 'Login'" |
| 5 | + /> |
4 | 6 |
|
5 | | - <div class="w-full overflow-auto z-0" id="scrollContainer"> |
6 | | - <div class="border bg-surface-red-2 px-5 py-3 text-base text-ink-red-4" v-if=" |
| 7 | + <div class="w-full overflow-auto z-0" id="scrollContainer"> |
| 8 | + <div |
| 9 | + class="border bg-surface-red-2 px-5 py-3 text-base text-ink-red-4" |
| 10 | + v-if=" |
7 | 11 | !isSignupFlow && |
8 | 12 | !isSiteLogin && |
9 | 13 | !$session.user && |
10 | 14 | !$route.meta.isLoginPage |
11 | | - "> |
12 | | - You are not logged in. |
13 | | - <router-link to="/login" class="underline">Login</router-link> to |
14 | | - access dashboard. |
15 | | - </div> |
| 15 | + " |
| 16 | + > |
| 17 | + You are not logged in. |
| 18 | + <router-link to="/login" class="underline">Login</router-link> |
| 19 | + to access dashboard. |
| 20 | + </div> |
16 | 21 |
|
17 | | - <router-view /> |
18 | | - </div> |
19 | | - </div> |
| 22 | + <router-view /> |
| 23 | + </div> |
| 24 | + </div> |
20 | 25 |
|
21 | | - <Toaster position="top-right" |
22 | | - :toastOptions="{ class: 'text-sm prose-sm dark:bg-surface-cards dark:border-outline-gray-2 text-ink-gray-9' }" /> |
23 | | - <component v-for="dialog in dialogs" :is="dialog" :key="dialog.id" /> |
24 | | - <SearchModal v-if="searchModalOpen" /> |
| 26 | + <Toaster |
| 27 | + position="top-right" |
| 28 | + :toastOptions="{ class: 'text-sm prose-sm dark:bg-surface-cards dark:border-outline-gray-2 text-ink-gray-9' }" |
| 29 | + /> |
| 30 | + <component v-for="dialog in dialogs" :is="dialog" :key="dialog.id" /> |
| 31 | + <SearchModal v-if="searchModalOpen" /> |
| 32 | + <PartnerRegistrationModal |
| 33 | + v-if="partnerRegistrationModalOpen" |
| 34 | + v-model="partnerRegistrationModalOpen" |
| 35 | + /> |
25 | 36 | </template> |
26 | 37 |
|
27 | 38 | <script setup> |
28 | | -import { computed, defineAsyncComponent, provide, ref, watch } from "vue"; |
29 | | -import { useRoute } from "vue-router"; |
30 | | -import { Toaster } from "vue-sonner"; |
31 | | -import SearchModal from "@/components/navigation/search/Popup.vue"; |
32 | | -import { useSearch } from "@/components/navigation/search/utils"; |
33 | | -import { searchModalOpen } from "@/data/ui"; |
34 | | -import { initTheme } from "@/utils/useTheme"; |
35 | | -import { session } from "./data/session.js"; |
36 | | -import { getTeam } from "./data/team"; |
37 | | -import { dialogs } from "./utils/components"; |
| 39 | +import { computed, defineAsyncComponent, provide, ref, watch } from 'vue' |
| 40 | +import { useRoute } from 'vue-router' |
| 41 | +import { Toaster } from 'vue-sonner' |
| 42 | +import SearchModal from '@/components/navigation/search/Popup.vue' |
| 43 | +import { useSearch } from '@/components/navigation/search/utils' |
| 44 | +import { partnerRegistrationModalOpen, searchModalOpen } from '@/data/ui' |
| 45 | +import { initTheme } from '@/utils/useTheme' |
| 46 | +import { session } from './data/session.js' |
| 47 | +import { getTeam } from './data/team' |
| 48 | +import { dialogs } from './utils/components' |
38 | 49 |
|
39 | 50 | import "@/styles/global.css" |
40 | 51 |
|
41 | 52 | const AppSidebar = defineAsyncComponent( |
42 | | - () => import("./components/navigation/sidebar/Sidebar.vue"), |
43 | | -); |
| 53 | + () => import('./components/navigation/sidebar/Sidebar.vue'), |
| 54 | +) |
| 55 | +const PartnerRegistrationModal = defineAsyncComponent( |
| 56 | + () => import('./onboarding/modal/PartnerOnboardingModal.vue'), |
| 57 | +) |
44 | 58 |
|
45 | | -const route = useRoute(); |
46 | | -const team = getTeam(); |
| 59 | +const route = useRoute() |
| 60 | +const team = getTeam() |
47 | 61 |
|
48 | 62 | const isHideSidebar = computed(() => { |
49 | 63 | const alwaysHideSidebarRoutes = [ |
50 | | - "Site Login", |
51 | | - "SignupLoginToSite", |
52 | | - "SignupSetup", |
53 | | - ]; |
54 | | - const alwaysHideSidebarPaths = ["/dashboard/site-login"]; |
| 64 | + 'Site Login', |
| 65 | + 'SignupLoginToSite', |
| 66 | + 'SignupSetup', |
| 67 | + ] |
| 68 | + const alwaysHideSidebarPaths = ['/dashboard/site-login'] |
55 | 69 |
|
56 | | - if (!session.user) return false; |
| 70 | + if (!session.user) return false |
57 | 71 | if ( |
58 | 72 | alwaysHideSidebarRoutes.includes(route.name) || |
59 | 73 | alwaysHideSidebarPaths.includes(window.location.pathname) |
60 | 74 | ) |
61 | | - return true; |
| 75 | + return true |
62 | 76 |
|
63 | 77 | return ( |
64 | 78 | route.meta.hideSidebar && session.user && team?.doc?.hide_sidebar === true |
65 | | - ); |
66 | | -}); |
| 79 | + ) |
| 80 | +}) |
67 | 81 |
|
68 | 82 | const isSignupFlow = ref( |
69 | | - window.location.pathname.startsWith("/dashboard/create-site") || |
70 | | - window.location.pathname.startsWith("/dashboard/setup-account") || |
71 | | - window.location.pathname.startsWith("/dashboard/site-login") || |
72 | | - window.location.pathname.startsWith("/dashboard/signup"), |
73 | | -); |
74 | | -const isSiteLogin = ref(window.location.pathname.endsWith("/site-login")); |
| 83 | + window.location.pathname.startsWith('/dashboard/create-site') || |
| 84 | + window.location.pathname.startsWith('/dashboard/setup-account') || |
| 85 | + window.location.pathname.startsWith('/dashboard/site-login') || |
| 86 | + window.location.pathname.startsWith('/dashboard/signup'), |
| 87 | +) |
| 88 | +const isSiteLogin = ref(window.location.pathname.endsWith('/site-login')) |
75 | 89 |
|
76 | 90 | watch( |
77 | 91 | () => route.name, |
78 | 92 | () => { |
79 | 93 | isSignupFlow.value = |
80 | | - window.location.pathname.startsWith("/dashboard/create-site") || |
81 | | - window.location.pathname.startsWith("/dashboard/setup-account") || |
82 | | - window.location.pathname.startsWith("/dashboard/site-login") || |
83 | | - window.location.pathname.startsWith("/dashboard/signup"); |
| 94 | + window.location.pathname.startsWith('/dashboard/create-site') || |
| 95 | + window.location.pathname.startsWith('/dashboard/setup-account') || |
| 96 | + window.location.pathname.startsWith('/dashboard/site-login') || |
| 97 | + window.location.pathname.startsWith('/dashboard/signup') |
84 | 98 | }, |
85 | | -); |
| 99 | +) |
86 | 100 |
|
87 | | -provide("team", team); |
88 | | -provide("session", session); |
| 101 | +provide('team', team) |
| 102 | +provide('session', session) |
89 | 103 |
|
90 | 104 | watch( |
91 | 105 | () => team?.doc?.onboarding?.complete, |
92 | 106 | (x) => { |
93 | | - if (x) useSearch(); |
| 107 | + if (x) useSearch() |
94 | 108 | }, |
95 | 109 | { once: true }, |
96 | | -); |
| 110 | +) |
97 | 111 |
|
98 | | -initTheme(); |
| 112 | +initTheme() |
99 | 113 | </script> |
0 commit comments