Skip to content

Commit

Permalink
Feature - Darken Commit messages (#17)
Browse files Browse the repository at this point in the history
* Darken commit-date as mentioned in issue #5
  • Loading branch information
jangerhard authored May 11, 2018
1 parent 36b3762 commit 4f28c14
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
17 changes: 15 additions & 2 deletions src/Components/CommitComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@ import moment from 'moment';
import PropTypes from 'prop-types';
import React from 'react';

const commitStyle = {
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
paddingLeft: "1em"
};

const dateStyle = {
opacity: ".5",
paddingLeft: "0.5em"
};

const CommitComponent = ({committedDate, abbreviatedOid, message}) => {

const date = moment(committedDate).fromNow();

return (
<div style={{paddingLeft: "1em"}}>
{abbreviatedOid}: {message} ({date})
<div style={commitStyle}>
{abbreviatedOid}: {message}
<div style={dateStyle}>{date}</div>
</div>
)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ exports[`renders commit correctly 1`] = `
<div
style={
Object {
"display": "flex",
"flexDirection": "row",
"justifyContent": "space-between",
"paddingLeft": "1em",
}
}
>
AAAAAA
:
This is a commit message
(
3 days ago
)
<div
style={
Object {
"opacity": ".5",
"paddingLeft": "0.5em",
}
}
>
3 days ago
</div>
</div>
`;

0 comments on commit 4f28c14

Please sign in to comment.