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 Results = ({ foundPRs }) => {
|
||||||
const elements = foundPRs.map((foundPR) => {
|
const elements = foundPRs.map((foundPR) => {
|
||||||
const { number, filenames } = foundPR;
|
const { number, filenames, username } = foundPR;
|
||||||
const files = filenames.map((filename, index) => {
|
const files = filenames.map((filename, index) => {
|
||||||
return <li key={`${number}-${index}`}>{filename}</li>;
|
return <li key={`${number}-${index}`}>{filename}</li>;
|
||||||
});
|
});
|
||||||
const prUrl = `https://github.com/freeCodeCamp/freeCodeCamp/pull/${number}`
|
const prUrl = `https://github.com/freeCodeCamp/freeCodeCamp/pull/${number}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={number}>
|
<div key={number}>
|
||||||
<h5>
|
<h5>
|
||||||
{!Number(number)
|
{!Number(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>
|
</h5>
|
||||||
<ul>
|
<ul>
|
||||||
|
Reference in New Issue
Block a user