Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
[Feature] EventRow - support GollumEvent #65
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Oct 22, 2017
1 parent a1b5480 commit 97f3594
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
26 changes: 26 additions & 0 deletions components/EventRow/EventRowMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,28 @@ class EventRowMobile extends PureComponent<Props> {
);
}

renderGollumEvent(event: PushEvent | PullRequestEvent): React$Element<any> {
return (
<View style={styles.right}>
<UIText>
<UIText style={styles.login}>{event.actor.login + ' '}</UIText>
{__(`EventRow.Actions.GullumEdit`)}
&nbsp;
{__('EventRow.In')}
<UIText style={styles.repoName}>{' ' + event.repo.name}</UIText>
</UIText>
<View style={styles.rightBottom}>
<UIText numberOfLines={1} style={styles.commentBody}>
{__(`EventRow.GullumActions.${event.payload.pages[0].action}`)}
&nbsp;
{event.payload.pages[0].page_name}
</UIText>
</View>
<UIText style={styles.eventDate}>{moment(event.created_at).fromNow()}</UIText>
</View>
);
}

renderReleaseEvent(event: PushEvent | PullRequestEvent): React$Element<any> {
return (
<View style={styles.right}>
Expand Down Expand Up @@ -427,6 +449,10 @@ class EventRowMobile extends PureComponent<Props> {
iconName = 'issue-opened';
content = this.renderIssuesEvent(event);
break;
case 'GollumEvent':
iconName = 'book';
content = this.renderGollumEvent(event);
break;
case 'WatchEvent':
iconName = 'star';
showAvatar = false;
Expand Down
5 changes: 5 additions & 0 deletions locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
EventRow: {
At: 'at',
To: 'to',
In: 'in',
Issue: 'issue',
PR: 'pull request',
Release: 'release',
Expand All @@ -56,6 +57,7 @@ export default {
TypeEventNotSupported: 'This type of event ({{eventType}}) does not supported inside this version',
UnexpectedException: 'Unexpected exception with Event\'s type ({{eventType}}) :(',
Actions: {
GullumEdit: 'edited a wiki page',
CommentedPR: 'commented on pull request',
CommentedCommit: 'commented on commit',
Closed: 'closed',
Expand All @@ -66,6 +68,9 @@ export default {
PushedTo: 'pushed to',
Starred: 'starred',
},
GullumActions: {
edited: 'Edited'
},
IssuesActions: {
assigned: 'assigned',
unassigned: 'unassigned',
Expand Down
5 changes: 5 additions & 0 deletions locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
EventRow: {
At: 'на',
To: 'в',
In: 'в',
Issue: 'задачу',
PR: 'pull-запрос',
Release: 'релиз',
Expand All @@ -59,6 +60,7 @@ export default {
TypeEventNotSupported: 'Данный тип события ({{eventType}}) не поддерживается в этой версии',
UnexpectedException: 'Неожиданное исключение в типе события ({{eventType}}) :(',
Actions: {
GullumEdit: 'отредактировал wiki страницу',
CommentedPR: 'прокомментировал pull-запрос',
CommentedCommit: 'прокомментировал коммит',
Closed: 'закрыл',
Expand All @@ -69,6 +71,9 @@ export default {
PushedTo: 'отправил в',
Starred: 'отметил',
},
GullumActions: {
edited: 'Отредактировал'
},
IssuesActions: {
assigned: 'назначил',
unassigned: 'разначил',
Expand Down

0 comments on commit 97f3594

Please sign in to comment.