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:
committed by
mrugesh mohapatra
parent
6b63642d3d
commit
e8aa30162a
@ -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> {username}</span>
|
||||
</>
|
||||
}
|
||||
</h5>
|
||||
<ul>
|
||||
|
Reference in New Issue
Block a user