Next.js Discord

Discord Forum

Code review

Unanswered
Maltese posted this in #help-forum
Open in Discord
MalteseOP
Hello! Can you tell me if I have organized the component well. Component preset Comment, which is composed of 3 parts: Avatar, Content, Description and Options. What I have tried to do is to move the logic for editing the comment into the component itself, so that it is self-contained without the need for external intervention to function. I am using both context and EditModeActions component which plays the role of Provider and renders children by passing them isEditMode and others

You can check it out in here: src->components->shared-comment
https://github.com/bockster6669/blog-app

1 Reply

MalteseOP
I have tried to recreate the youtube comments. That is, you can edit it, react to it, etc. On a new comment, I want to see only the user's avatar and a text box, while on a finished comment you can edit and react. I've tried to export some of this functionality into reusable components, but what I've noticed is that maybe I've made it too flexible, because you can add all kinds of stuff into it, however you want you can do it, and that's actually my question, Is my component too reusable? Please, if you have time to look at it, it is in src->components->shared->comment and src->components->post->id->CommentActions. Thanks in advance