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

ready #2570

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

ready #2570

wants to merge 2 commits into from

Conversation

AmateZz
Copy link

@AmateZz AmateZz commented Sep 22, 2024

src/App.tsx Outdated
Comment on lines 10 to 15
type Todo = {
userId: number;
id: number;
title: string;
completed: boolean;
};

Choose a reason for hiding this comment

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

move it to some separate file

Comment on lines 31 to 41
useEffect(() => {
getTodos()
.then(todosData => {
setTodos(todosData);
setLoading(false);
})
.catch(error => {
// eslint-disable-next-line no-console
console.error('Ошибка при загрузке задач:', error);
});
}, []);

Choose a reason for hiding this comment

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

you can move this logic to the App.tsx

Comment on lines 43 to 53
let filteredTodos = todos.filter(todo =>
todo.title.toLowerCase().includes(filterBy.toLowerCase()),
);

<tr data-cy="todo" className="">
<td className="is-vcentered">8</td>
<td className="is-vcentered">
<span className="icon" data-cy="iconCompleted">
<i className="fas fa-check" />
</span>
</td>
<td className="is-vcentered is-expanded">
<p className="has-text-success">quo adipisci enim quam ut ab</p>
</td>
<td className="has-text-right is-vcentered">
<button data-cy="selectButton" className="button" type="button">
if (filterBySelect !== 'all') {
if (filterBySelect === 'completed') {
filteredTodos = filteredTodos.filter(todo => todo.completed === true);
} else {
filteredTodos = filteredTodos.filter(todo => todo.completed === false);
}
}

Choose a reason for hiding this comment

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

same with this logic

Comment on lines 5 to 10
type Todo = {
userId: number;
id: number;
title: string;
completed: boolean;
};

Choose a reason for hiding this comment

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

just import the Todo type here


const todo = todos.find(cTodo => cTodo.id === modalShowId); // Поиск задачи по ID

// Загружаем данные пользователя при наличии todo

Choose a reason for hiding this comment

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

Remove comment. Try to write obvious code that explains all we need without comments)

Copy link

@anastasiiavorobiova anastasiiavorobiova left a comment

Choose a reason for hiding this comment

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

Great work!

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