From 3c792b57d34454ead87863d01ca791fec46d8f7b Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Wed, 3 Apr 2024 16:45:53 -0400 Subject: [PATCH] Update MainLayout --- src/lib/components/MainLayout.svelte | 215 ++++++++++---------- src/lib/components/accounts/OrgMenu.svelte | 11 +- src/lib/components/accounts/UserMenu.svelte | 8 +- 3 files changed, 116 insertions(+), 118 deletions(-) diff --git a/src/lib/components/MainLayout.svelte b/src/lib/components/MainLayout.svelte index 3e8f1324e..dcb70898c 100644 --- a/src/lib/components/MainLayout.svelte +++ b/src/lib/components/MainLayout.svelte @@ -1,13 +1,15 @@
- - -
- + {/if} + + +
+ {#if $$slots.navigation} + + {/if} + +
+ +
+ + {#if $$slots.action} + + {/if}
- +
.container { display: flex; + flex-direction: column; width: 100vw; height: 100vh; gap: 0; flex-shrink: 0; background: var(--gray-1, #f5f6f7); } + header { display: flex; - padding: 1rem; - gap: 0.5rem; - align-items: flex-start; - align-self: stretch; + flex-direction: row; + justify-content: space-between; + align-items: center; + background: var(--white, #ffffff); + border-bottom: 1px solid var(--gray-2, #d8dee2); + box-shadow: var(--shadow); + flex: 0 0 0; + padding: 0 1rem; + z-index: 1; } + main { - display: flex; - flex-direction: column; - padding: 1rem; - gap: 2rem; flex: 1 0 0; - max-height: 100%; - overflow-y: auto; + display: flex; + flex-direction: row; + overflow: hidden; } + nav { flex: 1 0 0; min-width: 16rem; max-width: 18rem; + max-height: 100%; + overflow-y: auto; display: flex; flex-direction: column; position: relative; + padding: 1rem; + gap: 1rem; + } + + article { + flex: 1 0 0; + display: flex; + flex-direction: row; + max-height: 100%; + max-width: 100%; + overflow-y: auto; } + .logo { - height: 2rem; + height: 1.5rem; width: auto; + padding: 0 0.5rem; } + + .breadcrumbs { + flex: 1 0 0; + } + .navigation { border-right: 1px solid var(--gray-2, #d8dee2); } + .action { border-left: 1px solid var(--gray-2, #d8dee2); } - .action footer { - display: flex; - width: 100%; - position: sticky; - bottom: 0; - padding: 1rem; - z-index: 1; - flex-direction: column; - align-items: flex-start; - gap: 0.875rem; - background: var(--gray-1, #f5f6f7); - } .content { padding: 0; } @@ -165,35 +197,14 @@ display: none; } - nav.small { - flex-direction: row; - justify-content: space-between; - align-items: center; - padding: 0.5rem; - flex: 0 0 0; - max-width: unset; - - border-bottom: 1px solid var(--gray-2, #d8dee2); - } - - nav.small .logo { - height: 1.5rem; - width: auto; - } - - .small.overlay { - display: block; - visibility: hidden; - } - @media (max-width: 64rem) { - .container { - flex-direction: column; - } .small { display: block; } - nav.large { + header { + gap: 1rem; + } + nav { min-width: 33vh; max-width: 100vh; display: flex; @@ -205,35 +216,25 @@ transition: transform 0.25s ease-in-out; overflow: hidden; } - nav.large.right { + nav.right { transform: translateX(100%); right: 0; border-top-left-radius: 1rem; border-bottom-left-radius: 1rem; } - nav.large.left { + nav.left { left: 0; transform: translateX(-100%); border-top-right-radius: 1rem; border-bottom-right-radius: 1rem; } - nav.large.active { + nav.active { display: flex; transform: translateX(0); transition: transform 0.25s ease-in-out; } - nav.large header { - align-items: center; - flex-direction: row-reverse; - padding: 0.5rem; - } - nav.large .logo { - display: none; - } - nav.small { - display: flex; - } .small.overlay { + visibility: hidden; position: fixed; z-index: 1; background: var(--gray-5, #233944); diff --git a/src/lib/components/accounts/OrgMenu.svelte b/src/lib/components/accounts/OrgMenu.svelte index 5509bef24..7d3b9909a 100644 --- a/src/lib/components/accounts/OrgMenu.svelte +++ b/src/lib/components/accounts/OrgMenu.svelte @@ -63,18 +63,9 @@ width: 2rem; } - /* Small styles */ @media (max-width: 64rem) { - .avatar { - height: 1.5rem; - width: 1.5rem; - } .name { - font-size: var(--font-l, 1.25rem); - } - .premium { - height: 1.5rem; - width: 1.5rem; + display: none; } } diff --git a/src/lib/components/accounts/UserMenu.svelte b/src/lib/components/accounts/UserMenu.svelte index 95903e69b..32a977dff 100644 --- a/src/lib/components/accounts/UserMenu.svelte +++ b/src/lib/components/accounts/UserMenu.svelte @@ -38,7 +38,7 @@ Avatar - {user.name} + {user.name} @@ -69,4 +69,10 @@ display: flex; align-items: center; } + + @media (max-width: 64rem) { + .name { + display: none; + } + }