-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #1163
base: master
Are you sure you want to change the base?
Develop #1163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/App.tsx
Outdated
</div> | ||
)} | ||
|
||
{!hasError && userPosts.length > 0 && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{!hasError && userPosts.length > 0 && ( | |
{!hasError && !!userPosts.length && ( |
src/components/PostDetails.tsx
Outdated
<article | ||
key={comment.id} | ||
className="message is-small" | ||
data-cy="Comment" | ||
> | ||
<div className="message-header"> | ||
<a href={`mailto:${comment.email}`} data-cy="CommentAuthor"> | ||
{comment.name} | ||
</a> | ||
<button | ||
data-cy="CommentDelete" | ||
type="button" | ||
className={classNames('button delete is-small', { | ||
'is-loading': deletingCommentId === comment.id, | ||
})} | ||
aria-label="delete" | ||
onClick={() => handleDeleteComment(comment.id)} | ||
></button> | ||
</div> | ||
|
||
<div className="message-body" data-cy="CommentBody"> | ||
{comment.body} | ||
</div> | ||
</article> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this logic to the CommentInfo
component
src/components/PostDetails.tsx
Outdated
</div> | ||
|
||
<div className="message-body" data-cy="CommentBody"> | ||
{comment.body} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use destructuring for comment
src/components/PostsList.tsx
Outdated
data-cy="PostButton" | ||
className={classNames('button is-link', { | ||
'is-light': selectedPost?.id !== post.id, | ||
})} // //Close (not is-light) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
})} // //Close (not is-light) | |
})} |
src/components/UserSelector.tsx
Outdated
href={`#user-${user.id}`} | ||
className={classNames('dropdown-item', { | ||
'is-active': selectedUser && selectedUser.id === user.id, | ||
})} //is-active |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
})} //is-active | |
})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ!
src/components/PostDetails.tsx
Outdated
eveniet quo quis laborum totam consequatur non dolor ut et est | ||
repudiandae est voluptatem vel debitis et magnam | ||
</p> | ||
<p data-cy="PostBody">{post.body}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using destruction assignment to post object
src/components/PostDetails.tsx
Outdated
data-cy="WriteCommentButton" | ||
type="button" | ||
className="button is-link" | ||
onClick={() => setIsFormActive(true)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding handler function
src/components/PostsList.tsx
Outdated
</thead> | ||
|
||
<tbody> | ||
{posts.map(post => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same wuith destruction assignment
src/components/UserSelector.tsx
Outdated
</a> | ||
{users.map(user => ( | ||
<a | ||
key={user.id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Не впевнена що я правильно зрозуміла, що потрібно було виправити |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
DEMO LINK
Не проходить 2 тести, але якщо дивитись в браузері DevTools, то все працює коректно ніби