Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
shymdima committed Dec 30, 2024
1 parent ba34bca commit 06ee427
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const App = () => {

<form action="/api/todos" method="POST" onSubmit={onSubmit}>
<div className="field">
<label htmlFor="titleInput">Todo title</label>
<input type="text"
data-cy="titleInput"
value={title}
Expand All @@ -78,6 +79,7 @@ export const App = () => {
</div>

<div className="field">
<label htmlFor="userSelect">User</label>
<select data-cy="userSelect" value={userId} onChange={
(event)=>{
setUserId(+event.target.value)
Expand Down
4 changes: 1 addition & 3 deletions src/components/TodoInfo/TodoInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from "react";
import users from "../../api/users";

import { todo, user } from "../types";
import { todo} from "../types";
import classNames from "classnames";
import { UserInfo } from "../UserInfo";

Expand Down
2 changes: 1 addition & 1 deletion src/components/TodoList/TodoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Props = {
export const TodoList: React.FC<Props> = ({todos}) => {
return (<section className="TodoList">
{todos.map(todo => [
<TodoInfo todo={todo}/>
<TodoInfo todo={todo} key = {todo.id}/>

Check failure on line 10 in src/components/TodoList/TodoList.tsx

View workflow job for this annotation

GitHub Actions / run_linter (20.x)

'todo' is already declared in the upper scope on line 1 column 10
])}

</section>)
Expand Down
1 change: 0 additions & 1 deletion src/components/UserInfo/UserInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import users from "../../api/users";
import { user } from "../types";

type Props = {
Expand Down

0 comments on commit 06ee427

Please sign in to comment.