Refactor and internationalize `IssueEventListItem`
- Langage dominant
- JavaScript
- Étoiles
- 4.8k
- Forks
- 771
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.