From 57af06a9fe155c62d853874827e2d62f8d7b5abc Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 26 Nov 2025 14:41:13 +0530 Subject: [PATCH] update: improved logic. --- src/lib/components/billing/gradientBanner.svelte | 4 +--- src/lib/components/navbar.svelte | 4 ++-- src/lib/components/sidebar.svelte | 10 +++++----- src/lib/layout/headerAlert.svelte | 11 +---------- src/lib/stores/headerAlert.ts | 12 ++++++++++-- .../database-[database]/subNavigation.svelte | 6 +++--- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/lib/components/billing/gradientBanner.svelte b/src/lib/components/billing/gradientBanner.svelte index 8b61fff3d..866112c3b 100644 --- a/src/lib/components/billing/gradientBanner.svelte +++ b/src/lib/components/billing/gradientBanner.svelte @@ -5,7 +5,6 @@ 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'; @@ -37,7 +36,6 @@ sidebar.style.height = `calc(100vh - ${offset}px)`; // for sidebar and sub-navigation! - bannerSpacing.set(`${alertHeight}px`); headerAlert.setTopSpacing(alertHeight); } @@ -46,7 +44,7 @@ } if (contentDiv && resolvedProfile.id === ProfileMode.STUDIO) { - const headerHeight = header?.getBoundingClientRect().height ?? 0; + const headerHeight = header?.getBoundingClientRect().height ?? 48; // push the content enough to show the borders of the content view! contentDiv.style.marginBlockStart = `${alertHeight + headerHeight}px`; } diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index cd798db9b..55d6438c4 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -57,7 +57,7 @@ import type { Models } from '@appwrite.io/console'; import { organization } from '$lib/stores/organization'; import { resolvedProfile } from '$lib/profiles/index.svelte'; - import { bannerSpacing } from '$lib/layout/headerAlert.svelte'; + import { headerAlert } from '$lib/stores/headerAlert'; let showSupport = false; @@ -121,7 +121,7 @@ beforeNavigate(() => (showAccountMenu = false)); - +
-
+
{#if subNavigation} {@const SubNavigation = subNavigation}
- import { writable } from 'svelte/store'; - - // this is for backwards compatibility rn. - export const bannerSpacing = writable(null); - -