Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created December 4, 2017 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/d66860879a25f39701c663d80035e1a0 to your computer and use it in GitHub Desktop.
Save dance2die/d66860879a25f39701c663d80035e1a0 to your computer and use it in GitHub Desktop.
import React from "react";
import shortid from 'shortid';
const PushEvent = ({ created_at: eventDate, repo, org, actor, payload }) => {
const { display_login: login, url: actorURL } = actor;
const { commits } = payload;
const { name: repoName, url: repoURL } = repo;
return (
<div>
<h3>Push - (<small>{eventDate}</small>)</h3>
<div>
<a href={actorURL}>{login}</a> has pushed to{" "}
<a href={repoURL}>{repoName}</a>
<Commits commits={commits} />
</div>
</div>
);
};
const Commits = ({commits}) => {
return (
<ul>
{commits.map(commit => (
<li key={shortid.generate()}>{commit.author.name} has commited with message "{commit.message}"</li>
))}
</ul>
);
};
export default PushEvent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment