From 4e1cc18421cc85ee09f055a2dbc0ee115957594a Mon Sep 17 00:00:00 2001 From: zurdi Date: Wed, 9 Apr 2025 16:26:28 +0000 Subject: [PATCH] fix: drawers height --- .../Gallery/AppBar/Platform/FirmwareDrawer.vue | 9 +++------ .../components/common/Navigation/CollectionsDrawer.vue | 3 ++- .../src/components/common/Navigation/PlatformsDrawer.vue | 3 ++- frontend/src/styles/common.css | 8 ++++++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/Gallery/AppBar/Platform/FirmwareDrawer.vue b/frontend/src/components/Gallery/AppBar/Platform/FirmwareDrawer.vue index eff71e58c..c6b3595c7 100644 --- a/frontend/src/components/Gallery/AppBar/Platform/FirmwareDrawer.vue +++ b/frontend/src/components/Gallery/AppBar/Platform/FirmwareDrawer.vue @@ -3,7 +3,6 @@ import type { FirmwareSchema } from "@/__generated__"; import DeleteFirmwareDialog from "@/components/common/Platform/Dialog/DeleteFirmware.vue"; import UploadFirmwareDialog from "@/components/common/Platform/Dialog/UploadFirmware.vue"; import storeAuth from "@/stores/auth"; -import storeNavigation from "@/stores/navigation"; import storeGalleryView from "@/stores/galleryView"; import storeRoms from "@/stores/roms"; import type { Events } from "@/types/emitter"; @@ -16,14 +15,12 @@ import { useI18n } from "vue-i18n"; // Props const { t } = useI18n(); -const { xs, mdAndUp, smAndDown } = useDisplay(); +const { xs, mdAndUp } = useDisplay(); const auth = storeAuth(); const romsStore = storeRoms(); const { currentPlatform } = storeToRefs(romsStore); const galleryViewStore = storeGalleryView(); const { activeFirmwareDrawer } = storeToRefs(galleryViewStore); -const navigationStore = storeNavigation(); -const { mainBarCollapsed } = storeToRefs(navigationStore); const { calculatedWidth } = calculateMainLayoutWidth(); const selectedFirmware = ref([]); const emitter = inject>("emitter"); @@ -61,9 +58,9 @@ function deleteSelectedFirmware() { location="bottom" v-model="activeFirmwareDrawer" :class="{ - 'my-2 px-1': activeFirmwareDrawer, + 'my-2 px-1 max-h-50': activeFirmwareDrawer, }" - class="bg-surface border-0 rounded mx-2 px-1 unset-height" + class="bg-surface border-0 rounded mx-2 px-1" :style="{ width: calculatedWidth, }" diff --git a/frontend/src/components/common/Navigation/CollectionsDrawer.vue b/frontend/src/components/common/Navigation/CollectionsDrawer.vue index 9022365cf..5f40c0182 100644 --- a/frontend/src/components/common/Navigation/CollectionsDrawer.vue +++ b/frontend/src/components/common/Navigation/CollectionsDrawer.vue @@ -78,7 +78,8 @@ onBeforeUnmount(() => { 'my-2': mdAndUp || (smAndDown && activeCollectionsDrawer), 'ml-2': (mdAndUp && activeCollectionsDrawer) || smAndDown, 'drawer-mobile': smAndDown, - 'unset-height': mdAndUp || (smAndDown && activeCollectionsDrawer), + 'unset-height': mdAndUp, + 'max-h-70': smAndDown && activeCollectionsDrawer, }" class="bg-surface pa-1" rounded diff --git a/frontend/src/components/common/Navigation/PlatformsDrawer.vue b/frontend/src/components/common/Navigation/PlatformsDrawer.vue index a40f80ac8..05871dae1 100644 --- a/frontend/src/components/common/Navigation/PlatformsDrawer.vue +++ b/frontend/src/components/common/Navigation/PlatformsDrawer.vue @@ -29,7 +29,8 @@ function clear() { 'my-2': mdAndUp || (smAndDown && activePlatformsDrawer), 'ml-2': (mdAndUp && activePlatformsDrawer) || smAndDown, 'drawer-mobile': smAndDown, - 'unset-height': mdAndUp || (smAndDown && activePlatformsDrawer), + 'unset-height': mdAndUp, + 'max-h-70': smAndDown && activePlatformsDrawer, }" class="bg-surface pa-1" rounded diff --git a/frontend/src/styles/common.css b/frontend/src/styles/common.css index a9ca0c73a..8f9a5aea2 100644 --- a/frontend/src/styles/common.css +++ b/frontend/src/styles/common.css @@ -78,3 +78,11 @@ body { .bottom-50 { bottom: 50px !important; } +.max-h-50 { + height: fit-content !important; + max-height: 50dvh !important; +} +.max-h-70 { + height: fit-content !important; + max-height: 70dvh !important; +}