From 34adcdcddf69f66eed70ff6ca4f48d882e96efbf Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 11 Jan 2023 09:11:35 +0000 Subject: [PATCH] Update more pages to be responsive and add mobile specific components --- packages/bbui/src/Layout/Page.svelte | 1 + .../src/components/portal/page/Content.svelte | 12 +++- .../src/components/portal/page/Header.svelte | 17 ++++- .../src/components/portal/page/SideNav.svelte | 8 +++ .../portal/overview/[appId]/_layout.svelte | 70 +++++++++++++------ 5 files changed, 86 insertions(+), 22 deletions(-) diff --git a/packages/bbui/src/Layout/Page.svelte b/packages/bbui/src/Layout/Page.svelte index 6e3cc55c12..15aabd2c61 100644 --- a/packages/bbui/src/Layout/Page.svelte +++ b/packages/bbui/src/Layout/Page.svelte @@ -72,6 +72,7 @@ background: var(--background); border-left: var(--border-light); width: 320px; + max-width: calc(100vw - 48px - 48px); overflow: auto; overflow-x: hidden; transform: translateX(100%); diff --git a/packages/builder/src/components/portal/page/Content.svelte b/packages/builder/src/components/portal/page/Content.svelte index e6ef93a179..083467b49b 100644 --- a/packages/builder/src/components/portal/page/Content.svelte +++ b/packages/builder/src/components/portal/page/Content.svelte @@ -1,9 +1,10 @@
-
+
@@ -28,4 +29,13 @@ .main.narrow { max-width: 600px; } + + @media (max-width: 640px) { + .content { + flex-direction: column; + } + .side-nav:not(.show-mobile) { + display: none; + } + } diff --git a/packages/builder/src/components/portal/page/Header.svelte b/packages/builder/src/components/portal/page/Header.svelte index be75c5271b..19a2cd59a8 100644 --- a/packages/builder/src/components/portal/page/Header.svelte +++ b/packages/builder/src/components/portal/page/Header.svelte @@ -2,9 +2,10 @@ import { Heading } from "@budibase/bbui" export let title + export let wrap = true -
+
{title}
@@ -20,10 +21,19 @@ align-items: center; gap: var(--spacing-xl); } + .header.wrap { + flex-wrap: wrap; + } .header :global(.spectrum-Heading) { flex: 1 1 auto; margin-top: -2px; } + .header:not(.wrap) :global(.spectrum-Heading) { + overflow: hidden; + width: 0; + white-space: nowrap; + text-overflow: ellipsis; + } .buttons { display: flex; flex-direction: row; @@ -34,4 +44,9 @@ .buttons :global(> div) { display: contents; } + @media (max-width: 640px) { + .wrap .buttons { + margin-bottom: var(--spacing-m); + } + } diff --git a/packages/builder/src/components/portal/page/SideNav.svelte b/packages/builder/src/components/portal/page/SideNav.svelte index fdd54b2182..e3e485fa30 100644 --- a/packages/builder/src/components/portal/page/SideNav.svelte +++ b/packages/builder/src/components/portal/page/SideNav.svelte @@ -23,4 +23,12 @@ color: var(--spectrum-global-color-gray-700); margin-bottom: var(--spacing-m); } + + @media (max-width: 640px) { + .side-nav { + border-bottom: var(--border-light); + margin: 0 -24px; + padding: 0 24px 32px 24px; + } + } diff --git a/packages/builder/src/pages/builder/portal/overview/[appId]/_layout.svelte b/packages/builder/src/pages/builder/portal/overview/[appId]/_layout.svelte index ef571a1edf..c1165d8550 100644 --- a/packages/builder/src/pages/builder/portal/overview/[appId]/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/overview/[appId]/_layout.svelte @@ -120,7 +120,7 @@ -
+
- - + + + + + + + + + View + + + + + Edit + + exportApp({ published: false })} icon="DownloadFromCloud" @@ -177,7 +195,7 @@
- + {/key} + +