forked from MapComplete/MapComplete
UI: hide header bar when appropriate
This commit is contained in:
parent
76a9a2ee23
commit
facba1e1a2
1 changed files with 12 additions and 5 deletions
|
@ -21,7 +21,9 @@
|
||||||
let bodyClass = bodyPadding + " h-full space-y-4 flex-1 overflow-y-auto overscroll-contain"
|
let bodyClass = bodyPadding + " h-full space-y-4 flex-1 overflow-y-auto overscroll-contain"
|
||||||
|
|
||||||
let headerClass = "flex justify-between items-center p-2 px-4 md:px-5 rounded-t-lg"
|
let headerClass = "flex justify-between items-center p-2 px-4 md:px-5 rounded-t-lg"
|
||||||
|
if (!$$slots.header) {
|
||||||
|
headerClass = "hidden"
|
||||||
|
}
|
||||||
export let shown: UIEventSource<boolean>
|
export let shown: UIEventSource<boolean>
|
||||||
let _shown = false
|
let _shown = false
|
||||||
shown.addCallbackAndRun(sh => {
|
shown.addCallbackAndRun(sh => {
|
||||||
|
@ -34,12 +36,17 @@
|
||||||
|
|
||||||
<Modal open={_shown} on:close={() => shown.set(false)} outsideclose
|
<Modal open={_shown} on:close={() => shown.set(false)} outsideclose
|
||||||
size="xl"
|
size="xl"
|
||||||
dismissable={false}P
|
dismissable={false}
|
||||||
{defaultClass} {bodyClass} {dialogClass} {headerClass}
|
{defaultClass} {bodyClass} {dialogClass} {headerClass}
|
||||||
color="none">
|
color="none">
|
||||||
<h1 slot="header" class="page-header w-full">
|
|
||||||
<slot name="header" />
|
<svelte:fragment slot="header">
|
||||||
</h1>
|
{#if $$slots.header}
|
||||||
|
<h1 class="page-header w-full">
|
||||||
|
<slot name="header" />
|
||||||
|
</h1>
|
||||||
|
{/if}
|
||||||
|
</svelte:fragment>
|
||||||
<slot />
|
<slot />
|
||||||
{#if $$slots.footer}
|
{#if $$slots.footer}
|
||||||
<slot name="footer" />
|
<slot name="footer" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue