gitpoint / gitpoint/git-point

Refactor and internationalize `IssueEventListItem`

Đang mở
#795 6 bình luận 1 reaction 1 người được giao Được @machour nhận Xem trên GitHub
good for beginners help wanted
Ngôn ngữ chính
JavaScript
Star
4.8k
Fork
771
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.