Skip to content

Commit

Permalink
even better UX, and a demo with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sereneinserenade committed Mar 26, 2022
1 parent 118fcbc commit 3e0a326
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/OuterComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
:class="[`${comment.jsonComments.uuid === activeCommentsInstance.uuid ? 'ml-4' : 'ml-8 cursor-pointer'}`]"
@click.stop.prevent="focusContent({ from: comment.from, to: comment.to })"
>
<article class="text-lg font-bold p-3 border-b-2 border-solid">"{{ comment.text }}" 💬</article>
<article
class="text-lg font-bold p-3 border-b-2 border-solid"
>{{ i + 1 }}. "{{ comment.text }}" 💬</article>

<article
v-for="(jsonComment, j) in comment.jsonComments.comments"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tiptap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const setCurrentComment = (editor: Editor) => {
const tiptapEditor = useEditor({
content: `
<p>I'm trying to make comment extension, so you can add comment here ☮️ and see how it goes. Add a comment here.</p>
<p>I'm trying to make comment extension, so you can add comment here ☮️ and<span data-comment="{&quot;uuid&quot;:&quot;d1858137-e0d8-48ac-9f38-ae778b56c719&quot;,&quot;comments&quot;:[{&quot;userName&quot;:&quot;sereneinserenade&quot;,&quot;time&quot;:1648338852939,&quot;content&quot;:&quot;First comment&quot;},{&quot;userName&quot;:&quot;sereneinserenade&quot;,&quot;time&quot;:1648338857073,&quot;content&quot;:&quot;Following Comment&quot;}]}"> see how it goes.</span> Add a <span data-comment="{&quot;uuid&quot;:&quot;f57e894f-926c-4242-b0ee-53c719631907&quot;,&quot;comments&quot;:[{&quot;userName&quot;:&quot;sereneinserenade&quot;,&quot;time&quot;:1648338869890,&quot;content&quot;:&quot;second comment&quot;}]}">comment</span> here.</p>
`,
extensions: [StarterKit, Comment],
Expand Down

1 comment on commit 3e0a326

@vercel
Copy link

@vercel vercel bot commented on 3e0a326 Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.