Skip to content

Commit

Permalink
fix ai remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
tania-kuzmenko committed Nov 16, 2024
1 parent 32347c7 commit 2f08574
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/components/NewCommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import React, { useState } from 'react';
import { Comment } from '../types/Comment';

type Props = {
postid: number;
postId: number;
isLoadingComments: boolean;
onSubmit: (comment: Comment) => void;
};

export const NewCommentForm: React.FC<Props> = ({
postid,
postId,
onSubmit,
isLoadingComments,
}) => {
Expand Down Expand Up @@ -63,7 +63,7 @@ export const NewCommentForm: React.FC<Props> = ({

onSubmit({
id: 0,
postId: postid,
postId: postId,
name: authorName,
email: authorEmail,
body: commentText,
Expand Down Expand Up @@ -116,7 +116,7 @@ export const NewCommentForm: React.FC<Props> = ({

{authorNameError && (
<p className="help is-danger" data-cy="ErrorMessage">
Name is required
{authorNameError}
</p>
)}
</div>
Expand Down Expand Up @@ -154,7 +154,7 @@ export const NewCommentForm: React.FC<Props> = ({
</div>
{authorEmailError && (
<p className="help is-danger" data-cy="ErrorMessage">
Email is required
{authorEmailError}
</p>
)}
</div>
Expand All @@ -178,7 +178,7 @@ export const NewCommentForm: React.FC<Props> = ({
</div>
{commentTextError.length > 0 && (
<p className="help is-danger" data-cy="ErrorMessage">
Enter some text
{commentTextError}
</p>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/PostDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const PostDetails: React.FC<Props> = ({
<div className="block">
{error && (
<div className="notification is-danger" data-cy="CommentsError">
Something went wrong
{error}
</div>
)}

Expand Down Expand Up @@ -95,7 +95,7 @@ export const PostDetails: React.FC<Props> = ({

{isFormOpen && (
<NewCommentForm
postid={post.id}
postId={post.id}
onSubmit={addComment}
isLoadingComments={isLoadingComments}
/>
Expand Down
1 change: 0 additions & 1 deletion src/components/PostsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Post } from '../types/Post';

type Props = {
posts: Post[];
isloadingComments?: boolean;
selectedPost: Post | null;
onClose?: () => void;
onOpen?: (post: Post) => void;
Expand Down

0 comments on commit 2f08574

Please sign in to comment.