Files
SCM-Manager/scm-ui/src/repos/components/changesets/ChangesetAuthor.js
2018-10-17 14:11:28 +02:00

38 lines
673 B
JavaScript

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