diff --git a/src/lib/components/billing/gradientBanner.svelte b/src/lib/components/billing/gradientBanner.svelte index 7f9b62a64..866112c3b 100644 --- a/src/lib/components/billing/gradientBanner.svelte +++ b/src/lib/components/billing/gradientBanner.svelte @@ -5,8 +5,9 @@ import { IconX } from '@appwrite.io/pink-icons-svelte'; import { isTabletViewport } from '$lib/stores/viewport'; import PinkBackground from '$lib/images/pink-background.svg'; - import { bannerSpacing } from '$lib/layout/headerAlert.svelte'; import { createEventDispatcher, onMount, onDestroy } from 'svelte'; + import { headerAlert } from '$lib/stores/headerAlert'; + import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte'; export let variant: 'gradient' | 'image' = 'gradient'; @@ -16,12 +17,13 @@ const queryLayoutElements = () => ({ header: document.querySelector('main > header'), sidebar: document.querySelector('main > div > nav'), - content: document.querySelector('main > div > section') + content: document.querySelector('main > div > section'), + contentDiv: document.querySelector('main > .content') }); const setNavigationHeight = () => { const alertHeight = container?.getBoundingClientRect()?.height || 0; - const { header, sidebar, content } = queryLayoutElements(); + const { header, sidebar, content, contentDiv } = queryLayoutElements(); const headerHeight = header?.getBoundingClientRect().height || 0; const offset = alertHeight + (!$isTabletViewport && header ? headerHeight : 0); @@ -34,12 +36,18 @@ sidebar.style.height = `calc(100vh - ${offset}px)`; // for sidebar and sub-navigation! - bannerSpacing.set(`${alertHeight}px`); + headerAlert.setTopSpacing(alertHeight); } if (content) { content.style.paddingBlockStart = `${alertHeight}px`; } + + if (contentDiv && resolvedProfile.id === ProfileMode.STUDIO) { + const headerHeight = header?.getBoundingClientRect().height ?? 48; + // push the content enough to show the borders of the content view! + contentDiv.style.marginBlockStart = `${alertHeight + headerHeight}px`; + } }; onMount(setNavigationHeight); diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index f157e3211..dcdf4eaee 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -57,6 +57,7 @@ import type { Models } from '@appwrite.io/console'; import { organization } from '$lib/stores/organization'; import { resolvedProfile } from '$lib/profiles/index.svelte'; + import { headerAlert } from '$lib/stores/headerAlert'; let showSupport = false; @@ -120,7 +121,7 @@ beforeNavigate(() => (showAccountMenu = false)); - +