diff --git a/src/lib/components/editor/imageTarget.svelte b/src/lib/components/editor/imageTarget.svelte index a458242..39749ae 100644 --- a/src/lib/components/editor/imageTarget.svelte +++ b/src/lib/components/editor/imageTarget.svelte @@ -18,15 +18,18 @@
- - {#if image} - - {:else} - + {:else if edit} + + + {:else if image} + + {:else} +
No Image
{/if} onFileSelected(e)} bind:this={fileinput} > diff --git a/src/lib/components/entrySummaryView.svelte b/src/lib/components/entrySummaryView.svelte index d42edb4..d0ae9d8 100644 --- a/src/lib/components/entrySummaryView.svelte +++ b/src/lib/components/entrySummaryView.svelte @@ -2,7 +2,7 @@ import { generateHTML } from "@tiptap/html"; import { StarterKit } from "@tiptap/starter-kit"; - const { entry } = $props(); + const { entry, clickCB } = $props(); const formatDate = (dateString) => { const date = new Date(dateString); @@ -11,14 +11,14 @@ }; -
  • +
  • {formatDate(entry.date)}

    {@html generateHTML(entry.content, [StarterKit])}
    diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 81bb558..77bdcfb 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -7,7 +7,14 @@ import Editor from '$lib/components/editor/index.svelte'; import EntrySummaryView from '$lib/components/entrySummaryView.svelte' - let edit = $state(true) + let edit = $state(false) + + let selectedEntry = $state() + + let selectEntry = async (entryID) => { + const res = await fetch(`/api/entry?id=${entryID}`) + selectedEntry = await res.json() + }
    @@ -15,12 +22,18 @@
      {#each data.all as entry} - + await selectEntry(entry.id)} {entry} /> {/each}
  • \ No newline at end of file diff --git a/src/routes/layout.css b/src/routes/layout.css index 680f5c0..613cb8b 100644 --- a/src/routes/layout.css +++ b/src/routes/layout.css @@ -11,6 +11,6 @@ html { } html body { - @apply font-[AmericanTypewriter]; + /*@apply font-[AmericanTypewriter];*/ /* @apply w-full md:w-[68%] mx-auto h-full; */ } \ No newline at end of file