From f05d5769ffecce8534b2402af5c763df5d3b2a2b Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 5 Aug 2024 17:17:06 +0200 Subject: [PATCH] feat: add new MainLayout to handle lock and modals with Suspense (async views) --- app/src/App.vue | 49 +------- app/src/components/layouts/MainLayout.vue | 133 ++++++++++++++++++++++ app/src/scss/_variables.scss | 1 + 3 files changed, 138 insertions(+), 45 deletions(-) create mode 100644 app/src/components/layouts/MainLayout.vue diff --git a/app/src/App.vue b/app/src/App.vue index 00f4d3a7..eaf8eee3 100644 --- a/app/src/App.vue +++ b/app/src/App.vue @@ -5,13 +5,13 @@ import { useStore } from 'vuex' import { useRequests } from '@/composables/useRequests' import { useSettings } from '@/composables/useSettings' import { useStoreGetters } from '@/store/utils' -import { HistoryConsole, ViewLockOverlay } from '@/views/_partials' +import { HistoryConsole } from '@/views/_partials' const store = useStore() -const { connected, yunohost, routerKey, ssoLink } = useStoreGetters() +const { connected, yunohost, ssoLink } = useStoreGetters() const { locked } = useRequests() -const { spinner, dark, transitions, transitionName } = useSettings() +const { spinner, dark } = useSettings() async function logout() { store.dispatch('LOGOUT') @@ -113,20 +113,7 @@ onMounted(() => { - - - -
- - - - - - - -
-
+ @@ -196,34 +183,6 @@ header { } } -main { - position: relative; - - // Routes transition - .animated { - transition: all 0.15s ease-in-out; - } - .slide-left-enter-from, - .slide-right-leave-active { - position: absolute; - width: 100%; - top: 0; - transform: translate(100vw, 0); - } - .slide-left-leave-active, - .slide-right-enter-from { - position: absolute; - width: 100%; - top: 0; - transform: translate(-100vw, 0); - } - // hack to hide last transition provoqued by the element change - // while disabling the transitions in ToolWebAdmin - .static ~ .animated { - display: none; - } -} - #console { // Allows the console to be tabbed before the footer links while remaining visually // the last element of the page diff --git a/app/src/components/layouts/MainLayout.vue b/app/src/components/layouts/MainLayout.vue new file mode 100644 index 00000000..9f55d2e1 --- /dev/null +++ b/app/src/components/layouts/MainLayout.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/app/src/scss/_variables.scss b/app/src/scss/_variables.scss index b484a896..bf6ab798 100644 --- a/app/src/scss/_variables.scss +++ b/app/src/scss/_variables.scss @@ -124,6 +124,7 @@ $h4-font-size: $font-size-base * 1.25; $h5-font-size: $font-size-base * 1.1; $list-group-item-padding-y: $spacer * 0.75; +$modal-md: 600px; // Import default variables after the above setup to compute all other variables. @import '~bootstrap/scss/variables';