Skip to content

Conversation

@armandovieirag
Copy link

No description provided.

@armandovieirag armandovieirag changed the title Solution: Nacho Montoya - Armando Vieira Solution: Nacho Montoya & Armando Vieira May 25, 2021
@danilucaci danilucaci self-requested a review May 28, 2021 11:02
Copy link
Contributor

@danilucaci danilucaci left a comment

Choose a reason for hiding this comment

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

Muy buen proyecto! Tanto a nivel de funcionalidades como de diseño! Felicidades! 👏🏻👏🏻👏🏻
Seguimos!

Comment on lines +10 to +12
const LOCAL_STORAGE_KEY = "all-todos";
const LOCAL_STORAGE_KEY_COMPLETED = "completed-todos";
const LOCAL_STORAGE_KEY_ACTIVE = "active-todos";
Copy link
Contributor

Choose a reason for hiding this comment

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

Muy bien pensado para que sea fácil de gestionar. También podríais tener todo en un objeto para tener solo una key en localStorage pero si os era más sencillo de gestionar así genial.

handleSubmit={this.handleSubmit}
handleChange={this.handleChange}
handleRemove={this.handleRemove}
// handleChecked={this.handleChecked}
Copy link
Contributor

Choose a reason for hiding this comment

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

En este caso se ha dejado el prop comentado y si probamos de marca un todo como completado desde esta página fallará porque el prop handleChecked será ejecutado como función pero será undefined.

TypeError: handleChecked is not a function
onsetHandlecompleted
src/components/CompletedButton/CompletedButton.js:13
  10 |   handleAddToActive,
  11 | }) {
  12 |   function onsetHandlecompleted() {
> 13 |     handleChecked(id);
  14 |     handleAddToComplete(id);
  15 |     handleAddToActive(id);
  16 |   }
View compiled

handleAddToActive(id);
}
return (
<>
Copy link
Contributor

Choose a reason for hiding this comment

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

En este caso el Fragment no es necesario ya que el input no tiene elementos mostrados al mismo nivel.

Comment on lines +1 to +25
.todo__input {
font-family: 'Maven Pro',
sans-serif;
font-weight:800;
width: 100% !important;
border: none;
}
form{
width: 90%;
}
.todo__input::placeholder {
opacity:0.5;
}


.todo__checkbox {
width: 25px;
height: 25px;
border-radius: 50%;
border: 1px solid #ddd;
-webkit-appearance: none;
outline: none;
cursor: pointer;
margin-top: 5px;
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Los saltos de línea deberían ser más uniformes. Lo más común es tener un solo salto de línea entre cada bloque de CSS.

Comment on lines +6 to +11
allTodos,
handleRemove,
handleChecked,
handleEditTodo,
handleAddToComplete,
handleAddToActive,
Copy link
Contributor

Choose a reason for hiding this comment

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

Muy buenos nombres de funciones, queda muy bien ordenado y claro 👏🏻👏🏻👏🏻

Comment on lines +47 to +48
{isEmpty && <NoTodos />}
{!isEmpty && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Esto se podría refactorizar a un ternary operator:

Además, podemos quitar también el Fragment ya que en este caso no es necesario.

{isEmpty ? (
  <NoTodos />
) : (
  activeTodos.map((todo) => (
    <TodosContainer
      key={todo.id}
      id={todo.id}
      name={todo.name}
      isComplete={todo.complete}
      handleRemove={handleRemove}
      handleChecked={handleChecked}
      handleAddToComplete={handleAddToComplete}
      handleAddToActive={handleAddToActive}
      handleEditTodo={handleEditTodo}
    />
  ))
)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants