From b902e765fd43d0be72b3eb851356320aac7a9ecf Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 20 May 2024 09:37:48 +0100 Subject: [PATCH] Observe size changes in tabs as a catch-all solution for incorrect underline sizing --- packages/bbui/src/Tabs/Tab.svelte | 69 ++++++++++--------- .../builder/app/[application]/_layout.svelte | 28 +++----- .../builder/src/stores/builder/builder.js | 11 --- 3 files changed, 48 insertions(+), 60 deletions(-) diff --git a/packages/bbui/src/Tabs/Tab.svelte b/packages/bbui/src/Tabs/Tab.svelte index f51ad96e05..627d7e525a 100644 --- a/packages/bbui/src/Tabs/Tab.svelte +++ b/packages/bbui/src/Tabs/Tab.svelte @@ -1,40 +1,28 @@ @@ -53,11 +56,12 @@
{#if icon} @@ -72,7 +76,8 @@ {/if} {title}
-{#if $selected.title === title} + +{#if isSelected} diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index 7d4958db04..6094c93a26 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -105,10 +105,6 @@ } onMount(async () => { - document.fonts.onloadingdone = e => { - builderStore.loadFonts(e.fontfaces) - } - if (!hasSynced && application) { try { await API.syncApp(application) @@ -149,19 +145,17 @@ /> - {#key $builderStore?.fonts} - {#each $layout.children as { path, title }} - - - - {/each} - {/key} + {#each $layout.children as { path, title }} + + + + {/each}
diff --git a/packages/builder/src/stores/builder/builder.js b/packages/builder/src/stores/builder/builder.js index 055498bc91..d002062da9 100644 --- a/packages/builder/src/stores/builder/builder.js +++ b/packages/builder/src/stores/builder/builder.js @@ -14,7 +14,6 @@ export const INITIAL_BUILDER_STATE = { tourKey: null, tourStepKey: null, hoveredComponentId: null, - fonts: null, } export class BuilderStore extends BudiStore { @@ -37,16 +36,6 @@ export class BuilderStore extends BudiStore { this.websocket } - loadFonts(fontFaces) { - const ff = fontFaces.map( - fontFace => `${fontFace.family}-${fontFace.weight}` - ) - this.update(state => ({ - ...state, - fonts: [...(state.fonts || []), ...ff], - })) - } - init(app) { if (!app?.appId) { console.error("BuilderStore: No appId supplied for websocket")