gitpoint / gitpoint/git-point

Refactor and internationalize `IssueEventListItem`

Abierto
#795 6 comentarios 1 reacción 1 asignado Reclamado por @machour Ver en GitHub
good for beginners help wanted
Lenguaje dominante
JavaScript
Estrellas
4.8k
Forks
771
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This component could benefit from a refactoring similar to `EventsScreen`, where every event type would be handled by a dedicated method.

Instead of the big switch/case in render(), we could have something like this:

```
render() {
const { repository, event } = this.props;
const handler = camelCase(`handle_${event.event}`); // lodash's camelCase

if (typeof this[handler] === 'function') {
return this[handler](event, repository);
}

return null;
}
```

and implement `handleReviewRequested()`, `handleLabeled()`, etc.

We would then wrap strings with `utils.t()` to internationalize this component.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.