Simplified modal header construction

This commit is contained in:
Dean 2022-04-20 09:23:09 +01:00
parent 9a49535748
commit 5b4535feca
1 changed files with 9 additions and 15 deletions

View File

@ -65,23 +65,17 @@
aria-modal="true" aria-modal="true"
> >
<div class="spectrum-Dialog-grid"> <div class="spectrum-Dialog-grid">
{#if title} <h1
<h1 class="spectrum-Dialog-heading spectrum-Dialog-heading--noHeader"
class="spectrum-Dialog-heading spectrum-Dialog-heading--noHeader" class:noDivider={!showDivider}
class:noDivider={!showDivider} class:header-spacing={$$slots.header}
class:header-spacing={$$slots.header} >
> {#if title}
{title} {title}
</h1> {:else if $$slots.header}
{:else if $$slots.header}
<h1
class="spectrum-Dialog-heading spectrum-Dialog-heading--noHeader"
class:noDivider={!showDivider}
class:header-spacing={$$slots.header}
>
<slot name="header" /> <slot name="header" />
</h1> {/if}
{/if} </h1>
{#if showDivider && (title || $$slots.header)} {#if showDivider && (title || $$slots.header)}
<Divider size="M" /> <Divider size="M" />
{/if} {/if}