gitpoint / gitpoint/git-point

Refactor and internationalize `IssueEventListItem`

Aperta
#795 6 commenti 1 reazione 1 assegnatario Rivendicata da @machour Vedi su GitHub
good for beginners help wanted
Lingua principale
JavaScript
Stelle
4.8k
Fork
771
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.