Skip to content

Commit

Permalink
Merge pull request #2519 from udecode/fix/playground-template-comment…
Browse files Browse the repository at this point in the history
…s-provider

Pass required values to `CommentsProvider` in template
  • Loading branch information
zbeyens committed Jul 17, 2023
1 parent ddebf8d commit c0eb53b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/plate/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ELEMENT_PARAGRAPH } from '@udecode/plate-paragraph';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';

import { commentsUsers, myUserId } from '@/lib/plate/comments';
import { MENTIONABLES } from '@/lib/plate/mentionables';
import { plugins } from '@/lib/plate/plate-plugins';
import { cn } from '@/lib/utils';
Expand Down Expand Up @@ -37,7 +38,7 @@ export default function Editor() {
</FixedToolbar>

<div className="flex">
<CommentsProvider>
<CommentsProvider users={commentsUsers} myUserId={myUserId}>
<div
ref={containerRef}
className={cn(
Expand Down
9 changes: 9 additions & 0 deletions src/lib/plate/comments.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const commentsUsers = {
1: {
id: '1',
name: 'zbeyens',
avatarUrl: 'https://avatars.githubusercontent.com/u/19695832?s=96&v=4',
},
};

export const myUserId = '1';

0 comments on commit c0eb53b

Please sign in to comment.