Files
SCM-Manager/scm-ui-components/packages/ui-components/src/repos/changesets/ChangesetAuthor.js

39 lines
688 B
JavaScript
Raw Normal View History

//@flow
import React from "react";
import type {Changeset} from "@scm-manager/ui-types";
type Props = {
changeset: Changeset
};
class ChangesetAuthor extends React.Component<Props> {
render() {
2018-10-17 14:11:28 +02:00
const { changeset } = this.props;
if (!changeset.author) {
return null;
}
2018-10-08 17:34:11 +02:00
2018-10-17 14:11:28 +02:00
const { name } = changeset.author;
return (
2018-10-04 16:00:02 +02:00
<>
2018-10-08 17:34:11 +02:00
{name} {this.renderMail()}
</>
);
}
renderMail() {
const { mail } = this.props.changeset.author;
if (mail) {
return (
<a className="is-hidden-mobile" href={"mailto:" + mail}>
&lt;
2018-10-08 17:34:11 +02:00
{mail}
&gt;
</a>
2018-10-08 17:34:11 +02:00
);
}
}
}
export default ChangesetAuthor;