This commit is contained in:
Torsten Simon 2025-04-30 12:26:28 +02:00
parent 1a7da6d1c1
commit 5028aca5ac
2 changed files with 6 additions and 3 deletions

View file

@ -10,7 +10,7 @@
import 'carta-md/default.css'; /* Default theme */ import 'carta-md/default.css'; /* Default theme */
import DOMPurify from 'dompurify'; import DOMPurify from 'dompurify';
console.log("show reactions", showReactions) console.log("show reactions", showReactions, event)
// Create a new instance of Carta (you might also want to add a sanitizer if you're processing user input) // Create a new instance of Carta (you might also want to add a sanitizer if you're processing user input)
@ -57,7 +57,9 @@
</script> </script>
<div class="comment w-full border p-2"> <div class="comment w-full border p-2">
<Markdown value={event.content} {carta} /> {#key event.content}
<Markdown {carta} value={event.content} />
{/key}
<div class="flex gap-2 reactions"> <div class="flex gap-2 reactions">
{#if $reacted} {#if $reacted}

View file

@ -38,6 +38,7 @@
console.log('ndk ready'); console.log('ndk ready');
const sub = $ndk.subscribe({ kinds: [2222], '#E': [data.id] }); const sub = $ndk.subscribe({ kinds: [2222], '#E': [data.id] });
sub.on('event', (event) => { sub.on('event', (event) => {
console.log(event);
$comments = [...$comments, event]; $comments = [...$comments, event];
console.log(`${event.content}`); console.log(`${event.content}`);
}); });
@ -69,7 +70,7 @@
<div class="main-layout mx-auto flex w-3/4 flex-col items-center justify-center"> <div class="main-layout mx-auto flex w-3/4 flex-col items-center justify-center">
{#if $question} {#if $question}
<button class="btn" onclick={() => startReactions($question)}>Start Reaktionen</button> <button class="btn btn-primary mb-4" onclick={() => startReactions($question)}>Reaktionen/Voting aktivieren</button>
<div class="question mb-4 w-full rounded border p-4 text-xl"> <div class="question mb-4 w-full rounded border p-4 text-xl">
<h2 class="text-xl font-bold">Frage / Thema:</h2> <h2 class="text-xl font-bold">Frage / Thema:</h2>