Skip to content
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

solution #858

Closed
wants to merge 1 commit into from
Closed

solution #858

wants to merge 1 commit into from

Conversation

MaxSchmide
Copy link

@MaxSchmide MaxSchmide commented Jul 18, 2023

Copy link

@DanilWeda DanilWeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.
Check improvements and test suits!

Comment on lines +12 to +18
export interface ProvidedValue {
posts: Post[],
selectedPost: Post | null,
isPostsPending: boolean,
isPostsError: boolean,
handleSelectPost: (post: Post) => void
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move it to a separate file.

Comment on lines +9 to +16
export interface ProvidedValue {
comments: Comment[],
isCommentsPending: boolean,
isCommentsError: boolean,
addingComment: boolean,
handleDeleteComment: (commentId: number) => Promise<void>,
handleAddComment: (data: CommentData) => Promise<void>,
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move it into a separate file.

>
<div className="dropdown-trigger">
<button
type="button"
className="button"
aria-haspopup="true"
aria-controls="dropdown-menu"
onClick={() => setShowDropdown(prev => !prev)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a handler.

className={classNames('dropdown-item', {
'is-active': selectedUser?.id === user.id,
})}
onClick={() => handleSelectUser(user)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a handler.

className={classNames('button is-link', {
'is-light': selectedPost?.id !== post.id,
})}
onClick={() => handleSelectPost(post)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a handler.

type="button"
className="delete is-small"
aria-label="delete"
onClick={() => handleDeleteComment(comment.id)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a handler.

Comment on lines +14 to +16
const [nameError, setNameError] = useState(false);
const [emailError, setEmailError] = useState(false);
const [bodyError, setBodyError] = useState(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many states. Try to unite them.

@MaxSchmide MaxSchmide closed this by deleting the head repository Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants