From a1800d0e4a8bde07a404dcb3742f1893e70092a1 Mon Sep 17 00:00:00 2001 From: Marina Avramenko Date: Fri, 30 Aug 2024 13:33:34 +0300 Subject: [PATCH] add task solution --- src/App.tsx | 1 + src/components/NewCommentForm.tsx | 4 ++-- src/components/PostsList.tsx | 3 +-- src/components/UserSelector.tsx | 8 ++++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 09853a2d7..d0819d287 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -51,6 +51,7 @@ export const App: React.FC = () => { users={users} selectedUser={selectedUser} onSelect={setSelectedUser} + setSelectedPost={setSelectedPost} /> diff --git a/src/components/NewCommentForm.tsx b/src/components/NewCommentForm.tsx index 74ad32380..b91d84683 100644 --- a/src/components/NewCommentForm.tsx +++ b/src/components/NewCommentForm.tsx @@ -140,7 +140,7 @@ export const NewCommentForm: React.FC = ({ postId, updateComent }) => {
= ({ postId, updateComent }) => { value={body} name="body" placeholder="Type comment here" - className={cn('textarea', { 'is-danger': hasEmailError })} + className={cn('textarea', { 'is-danger': hasBodyError })} onChange={handleOnChange} />
diff --git a/src/components/PostsList.tsx b/src/components/PostsList.tsx index 852ca8098..842919749 100644 --- a/src/components/PostsList.tsx +++ b/src/components/PostsList.tsx @@ -30,7 +30,6 @@ export const PostsList: React.FC = ({ # Title - {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */} @@ -42,7 +41,7 @@ export const PostsList: React.FC = ({ return ( {id} - {title} + {title}