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" 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}`) throw new Error(`Invalid size: ${size}`)
} }
</script> </script>
{#if size === 'inherit'}
<div {...$$props} class={cx($$props.class, className)}>
<slot />
</div>
{/if}
{#if size === 'lg'} {#if size === 'lg'}
<div {...$$props} class={cx($$props.class, className, "p-2 py-16 max-w-lg")}> <div {...$$props} class={cx($$props.class, className, "p-2 py-16 max-w-lg")}>
<slot /> <slot />
@ -17,7 +23,7 @@
{/if} {/if}
{#if size === '2xl'} {#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 /> <slot />
</div> </div>
{/if} {/if}

View File

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