Skip to content

fix(pr): show merged pull requests #852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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