- 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.ts
and add a methodgetUserPosts(userId)
there - Load
posts
and show them using thePostsList
on page load. (useuseEffect
as acomponentDidMount
) - Implement the
UserSelect
to show only theposts
of the selected user. (callgetUserPosts
each time when user changes) - Each
post
has anOpen
button that sets aselectedPostId
in theApp
. - After opening the details the
Open
button becomesClose
and will close the details on click. PostDetails
component should be shown only after selecting apost
.- Create
getPostDetails(postId)
method in/src/api/posts.ts
and load post details from/posts/:postId
- Create
getPostComments(postId)
method in/src/api/comments.ts
, load comments from/comments
and filter them using a givenpostId
- Add a button to
show
/hide
comments. - Add an
X
button 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.