- Replace
<your_account>with your Github username in the DEMO LINK - Follow the React task guideline
- Use React TypeScript cheat sheet
You are given a basic markup and the API.
Implement the app to manage post comments.
Don't use class components. Use React Hooks instead.
- Create an
/src/api/posts.tsand add a methodgetUserPosts(userId)there - Load
postsand show them using thePostsListon page load. (useuseEffectas acomponentDidMount) - Implement the
UserSelectto show only thepostsof the selected user. (callgetUserPostseach time when user changes) - Each
posthas anOpenbutton that sets aselectedPostIdin theApp. - After opening the details the
Openbutton becomesCloseand will close the details on click. PostDetailscomponent should be shown only after selecting apost.- Create
getPostDetails(postId)method in/src/api/posts.tsand load post details from/posts/:postId - Create
getPostComments(postId)method in/src/api/comments.ts, load comments from/commentsand filter them using a givenpostId - Add a button to
show/hidecomments. - Add an
Xbutton near each comment to delete it on the server. - Add a form to add a new comment to the current post
- Comments should be immediately updated after adding or removing.