mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 12:05:52 +01:00
38 lines
673 B
JavaScript
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}>
|
|
<
|
|
{mail}
|
|
>
|
|
</a>
|
|
);
|
|
}
|
|
}
|
|
}
|