Fix partials/notes content layout

This commit is contained in:
Jonathan Staab 2023-01-23 20:05:30 -08:00
parent c5ce8cf0d5
commit 9ceb3e3e74
2 changed files with 24 additions and 16 deletions

View File

@ -5,11 +5,17 @@
const className = "flex flex-col m-auto text-white gap-6"
if (!['lg', '2xl'].includes(size)) {
if (!['inherit', 'lg', '2xl'].includes(size)) {
throw new Error(`Invalid size: ${size}`)
}
</script>
{#if size === 'inherit'}
<div {...$$props} class={cx($$props.class, className)}>
<slot />
</div>
{/if}
{#if size === 'lg'}
<div {...$$props} class={cx($$props.class, className, "p-2 py-16 max-w-lg")}>
<slot />
@ -17,7 +23,7 @@
{/if}
{#if size === '2xl'}
<div {...$$props} class={cx($$props.class, className, "p-4 lg:py-8 max-w-2xl")}>
<div {...$$props} class={cx($$props.class, className, "p-4 max-w-2xl")}>
<slot />
</div>
{/if}

View File

@ -46,19 +46,21 @@
})
</script>
{#if newNotes.length > 0}
<div
<Content size="inherit" class="pt-6">
{#if newNotes.length > 0}
<div
in:slide
class="cursor-pointer text-center underline text-light"
on:click={showNewNotes}>
Load {quantify(newNotes.length, 'new note')}
</div>
{/if}
</div>
{/if}
<div>
<div>
{#each notes as note (note.id)}
<Note {note} {depth} />
{/each}
</div>
</div>
<Spinner />
<Spinner />
</Content>