gitpoint / gitpoint/git-point

Refactor and internationalize `IssueEventListItem`

オープン
#795 コメント 6 件 リアクション 1 件 担当者 1 名 @machour が担当を希望しています GitHub で見る
good for beginners help wanted
主要言語
JavaScript
スター
4.8k
フォーク
771
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。