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

53 lines
1.1 KiB
JavaScript
Raw Normal View History

//@flow
import React from "react";
import type { Changeset } from "@scm-manager/ui-types";
import { ExtensionPoint } from "@scm-manager/ui-extensions";
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
<>
{name} {this.renderMail()} {this.renderAuthorMetadataExtensionPoint()}
2018-10-08 17:34:11 +02:00
</>
);
}
renderAuthorMetadataExtensionPoint = () => {
const { changeset } = this.props;
return (
<ExtensionPoint
name="changesets.changeset.author.metadata"
props={{ changeset }}
renderAll={true}
>
asas
</ExtensionPoint>
);
};
2018-10-08 17:34:11 +02:00
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;