Skip to content

Solution: Ricard Garcia & Victor Hugo Gomez #6

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

Open
wants to merge 67 commits into
base: main
Choose a base branch
from

Conversation

labietelabiete
Copy link

No description provided.

@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 bien proyecto! Felicidades! 👏🏻👏🏻 Habéis cumplido muchos requisitos extra también!

@@ -0,0 +1,87 @@
### First meeting
Copy link
Contributor

Choose a reason for hiding this comment

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

Muy interesante la organización! 👏🏻

import CreateTodo from "./components/CreateTodo";
import TodoList from "./components/TodoList";

const CUSTOM_LS_KEY = "todos";
Copy link
Contributor

Choose a reason for hiding this comment

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

Los nombres de variables deberían ser más descriptivos. Realmente no se puede saber para qué sirve esta variable sin llegar a leer dónde se utiliza como argumento de una función. Un nombre más correcto sería: CUSTOM_LOCALSTORAGE_KEY

componentDidUpdate() {
const { todos } = this.state;
// eslint-disable-next-line no-console
console.log(this.state);
Copy link
Contributor

Choose a reason for hiding this comment

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

Se deberían eliminar las llamadas a console.log en la versión final del proyecto.

Comment on lines +76 to +88
const selInput = document.getElementById(`input-${todoId}`);
selInput.disabled = !selInput.disabled;
const { todos } = this.state;
const updatedTodos = todos.map((todo) => {
if (todo.id === todoId) {
return {
...todo,
done: !todo.done,
};
}
return todo;
});
this.setState({ todos: updatedTodos });
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 implementado!

Comment on lines +156 to +157
? "https://images.unsplash.com/photo-1483728642387-6c3bdd6c93e5?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1955&q=80"
: "https://images.unsplash.com/flagged/photo-1551301622-6fa51afe75a9?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80"
Copy link
Contributor

Choose a reason for hiding this comment

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

Estas URL de imágenes se podrían guardar en una variable más arriba y usar el nombre de la variable aquí para que el código sea más legible.

Comment on lines +58 to +61
{/* <input type="checkbox" name="checkbox" /> */}
<div className="custom-checkbox d-flex flex-column justify-content-center align-items-center">
{/* <i className="uil uil-check text-center" /> */}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Se debería eliminar el código comentado ya que no se utiliza.


const classNames = require("classnames");

function MainFooter({ todosLeft, darkMode, handleClearCompleted }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

El prop darkMode se podría renombrar al algo como: isDarkModeActive para que sea más claro que es una prop de tipo boolean.

Comment on lines +12 to +30
const darkModeTodosLeft = classNames({
"items-left footer-item": true,
"footer-item-dark": darkMode,
});

const darkModeClear = classNames({
"clear-all-div footer-item clear-button": true,
"footer-item-dark": darkMode,
});

const darkModeNavLink = classNames({
"nav-link": true,
"nav-link-dark": darkMode,
});

const darkModeActive = classNames({
active: true,
"active-dark": darkMode,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Estas clases se podrían renombrar para acabar en Classes siempre. De esta forma al leer el código podremos ver variables llamadas: darkModeActiveClasses y que sea más obvio que es un objeto de clases.

<div className={darkModeTodosLeftClasses}>{todosLeft} todos left</div>

Comment on lines +58 to +67
const inputClasses = classNames({
"edit-todo-input": true,
"done-todo-text": done,
"edit-todo-input-dark": darkMode,
});

const closeClasses = classNames({
"close uil uil-times": true,
"close-dark": darkMode,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Este es un muy buen ejemplo de nombrar las variables acabando en Classes 👏🏻👏🏻. De esta forma es muy claro que esa variable tiene clases.

</div>
</div>
<form onSubmit={this.insideEditedTodo}>
<input
Copy link
Contributor

Choose a reason for hiding this comment

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

Los inputs deberían tener siempre un label asignado con un text que describa el input. Si no queremos que se vea visualmente el label podemos usar una convención muy común que usa clases llamadas .sr-only que lo que hace es esconder visualmente el elemento en la página pero si que está renderizado para los lectores de pantalla y el navegador.

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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