The community posts' comments /replies should also support rich text and media array, just like community posts.
For this, we are going to use TextEditor so as to let users type in rich text. The comment/replies should be stored as prosemirror docs (just like community posts)
The CommunityCommentSchema and ReplySchema both contain content and media props.
So, now the content will be of type content: { type: mongoose.Schema.Types.Mixed, required: true } (for both comment and reply schemas) just like what we did for community posts.
The media should accept media items posted from frontend, just like how community posts do. There should be a carousel that let user upload/edit media (we can reuse the carousel used in CreatePostDialog)
The existing comments/replies' string based content should continue to be supported for backward compatibility. For this, you can refer to how it is done for community posts as earlier the post.content was also of string type, instead of Mixed
The community posts' comments /replies should also support rich text and media array, just like community posts.
For this, we are going to use TextEditor so as to let users type in rich text. The comment/replies should be stored as prosemirror docs (just like community posts)
The
CommunityCommentSchemaandReplySchemaboth containcontentandmediaprops.So, now the
contentwill be of typecontent: { type: mongoose.Schema.Types.Mixed, required: true }(for both comment and reply schemas) just like what we did for community posts.The
mediashould accept media items posted from frontend, just like how community posts do. There should be a carousel that let user upload/edit media (we can reuse the carousel used inCreatePostDialog)The existing comments/replies' string based content should continue to be supported for backward compatibility. For this, you can refer to how it is done for community posts as earlier the
post.contentwas also ofstringtype, instead ofMixed