Skip to content

Commit

Permalink
fix(pr): show merged pull requests (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinesedfan authored Nov 23, 2018
1 parent 54b5ff3 commit 85ea4e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/components/issue-list-item.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ const getIconName = (type, issue) => {
return 'git-pull-request';
};

const getIconColor = issue => {
if (issue.state === 'open') {
return colors.green;
} else if (issue.state === 'merged') {
return colors.purple;
}

return colors.red;
};

export const IssueListItem = ({ type, issue, navigation, locale }: Props) => (
<TouchableHighlight
style={issue.state === 'closed' && styles.closedIssue}
Expand Down Expand Up @@ -92,7 +102,7 @@ export const IssueListItem = ({ type, issue, navigation, locale }: Props) => (
leftIcon={{
name: getIconName(type, issue),
size: 36,
color: issue.state === 'open' ? colors.green : colors.red,
color: getIconColor(issue),
type: 'octicon',
}}
hideChevron
Expand Down
2 changes: 1 addition & 1 deletion src/repository/screens/pull-list.screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class PullList extends Component {
return searchType === 0
? navigation.state.params.issues.filter(issue => issue.state === 'open')
: navigation.state.params.issues.filter(
issue => issue.state === 'closed'
issue => issue.state === 'closed' || issue.state === 'merged'
);
};

Expand Down

0 comments on commit 85ea4e2

Please sign in to comment.