From 034097e2d2297708dce5f9500664a01cb178dc86 Mon Sep 17 00:00:00 2001 From: Ortwin Date: Sun, 11 Feb 2024 12:13:46 +0100 Subject: [PATCH] moved post details to dialog --- src/components/dialogs/ConfirmDialog.svelte | 24 ++++--- src/components/ui/PostDetails.svelte | 74 +++++++++++++++------ src/data/lang/de.json | 3 +- src/data/lang/en.json | 3 +- src/model/post.model.ts | 29 +++++++- src/styles/app.scss | 18 +++++ 6 files changed, 116 insertions(+), 35 deletions(-) diff --git a/src/components/dialogs/ConfirmDialog.svelte b/src/components/dialogs/ConfirmDialog.svelte index b505fcc..e62f09d 100644 --- a/src/components/dialogs/ConfirmDialog.svelte +++ b/src/components/dialogs/ConfirmDialog.svelte @@ -20,16 +20,18 @@ {title} -
- - -
+ +
+ + +
+
{#if size == 'auto'}
@@ -46,13 +48,13 @@ width: auto; height: auto; z-index: 121; - background-color: var(--primback); } div.dialog { min-width: 22.5em; max-width: 100vw; max-height: 100vh; + background-color: white; } div.full { diff --git a/src/components/ui/PostDetails.svelte b/src/components/ui/PostDetails.svelte index ac5bc71..58caf6a 100644 --- a/src/components/ui/PostDetails.svelte +++ b/src/components/ui/PostDetails.svelte @@ -1,44 +1,73 @@

{title}

-{#if collapsed} - + {excerpt} {#if showMore} - + {/if} -{:else} -
+ +{#if visible} + + + {title} + + +
{#each content as entry} - {@html marked(entry.value, options)} + {#if entry.type === 'youtube'} + +
+ {:else if entry.type === 'quote'} +
+ {entry.value.text} + {entry.value.cite} +
+ {:else if entry.type === 'images'} + {#each entry.value as src} + {src.split('/')?.at(-1)}/ + {/each} + {:else} +

{@html marked(`${entry.value}`, options)}

+ {/if} {/each} -
- -
-
+ + + +
+ +
+
+ {/if}