Merge pull request #7 from RandellDawson/feature/display-username-with-prs

Added the ability for usernames to be displayed along with found PRs.
This commit is contained in:
Randell Dawson
2018-11-22 11:36:13 -08:00
committed by mrugesh mohapatra
parent 6b63642d3d
commit e8aa30162a

View File

@ -2,17 +2,21 @@ import React from 'react';
const Results = ({ foundPRs }) => {
const elements = foundPRs.map((foundPR) => {
const { number, filenames } = foundPR;
const { number, filenames, username } = foundPR;
const files = filenames.map((filename, index) => {
return <li key={`${number}-${index}`}>{filename}</li>;
});
const prUrl = `https://github.com/freeCodeCamp/freeCodeCamp/pull/${number}`
return (
<div key={number}>
<h5>
{!Number(number)
? number
: <a href={prUrl} rel="noopener noreferrer" target="_blank">{number}</a>
: <>
<a href={prUrl} rel="noopener noreferrer" target="_blank">{number}</a>
<span>&nbsp;{username}</span>
</>
}
</h5>
<ul>