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

Develop #2921

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Develop #2921

wants to merge 5 commits into from

Conversation

Shmyhelskiy
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Thank you for your hard work on this project! There are a few critical issues that need to be addressed before we can approve the pull request. Specifically, the typo in the function name handlUser should be corrected to handleUser for clarity and consistency. Additionally, the useState hooks for hasUserError and hasTitleError should be initialized with boolean values instead of strings, as they are meant to track error states. Once these changes are made, your code will be in great shape! Keep up the great work! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

src/App.tsx Outdated

export const App = () => {
const [title, setTitle] = useState('');
const [hasTitleError, setHasTitleError] = useState('');

Choose a reason for hiding this comment

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

The useState hook for hasTitleError should be initialized with a boolean value (e.g., false) instead of an empty string, as it is used to track the presence of an error.

src/App.tsx Outdated
const [hasTitleError, setHasTitleError] = useState('');

const [selectedUserId, setSelectedUserId] = useState(0);
const [hasUserError, setHasUserError] = useState('');

Choose a reason for hiding this comment

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

The useState hook for hasUserError should be initialized with a boolean value (e.g., false) instead of an empty string, as it is used to track the presence of an error.

src/App.tsx Outdated
setHasTitleError('');
};

const handlUser = (event: React.ChangeEvent<HTMLSelectElement>) => {

Choose a reason for hiding this comment

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

There is a typo in the function name handlUser. It should be handleUser to maintain consistency and clarity in naming conventions.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Great job on addressing the previous issues and making improvements to your code! 🎉 Your SCSS file is well-structured, and the use of BEM naming conventions is commendable. The App.tsx file is mostly well-implemented, but please correct the import paths for getHigherId and getUserById functions to ensure the application functions correctly. Similarly, verify the import paths for the Todo and User types across your components to maintain proper type checking and avoid redundancy.

You've made excellent progress by correcting the function name and initializing the useState hooks appropriately. Keep up the good work, and make sure to address these minor issues in the future to enhance your code's functionality and maintainability. This decision is made to help you move forward with your learning journey. Keep improving and learning from these experiences! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

import usersFromServer from './api/users';
import todosFromServer from './api/todos';
import { TodoList } from './components/TodoList';
import { getHigherId } from './serveses/todos';

Choose a reason for hiding this comment

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

The import path './serveses/todos' seems to be incorrect. Please verify the correct path for the getHigherId function.

import todosFromServer from './api/todos';
import { TodoList } from './components/TodoList';
import { getHigherId } from './serveses/todos';
import { getUserById } from './serveses/user';

Choose a reason for hiding this comment

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

The import path './serveses/user' seems to be incorrect. Please verify the correct path for the getUserById function.

import classNames from 'classnames';
import React from 'react';
import { UserInfo } from '../UserInfo';
import { Todo } from '../../serveses/types';

Choose a reason for hiding this comment

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

The import path '../../serveses/types' seems to be incorrect. Please verify the correct path for the Todo type.

export const TodoList = () => {};
import React from 'react';
import { TodoInfo } from '../TodoInfo';
import { Todo } from '../../serveses/types';

Choose a reason for hiding this comment

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

The import path '../../serveses/types' seems to be incorrect. Please verify the correct path for the Todo type.

@@ -1 +1,14 @@
export const UserInfo = () => {};
import React from 'react';
import { User } from '../../serveses/types';

Choose a reason for hiding this comment

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

The import path '../../serveses/types' seems to be incorrect. Please verify the correct path for the User type.

name: string;
username: string;
email: string;
};

Choose a reason for hiding this comment

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

The User type is redefined here, which is unnecessary. Consider importing the User type from types.ts to maintain consistency and avoid redundancy.

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.

2 participants