move changesets and avatar components to ui-components

This commit is contained in:
Sebastian Sdorra
2018-12-10 08:45:59 +01:00
parent 8d622f548d
commit 97c4b0998b
18 changed files with 74 additions and 47 deletions

View File

@@ -0,0 +1,38 @@
//@flow
import React from "react";
import type {Changeset} from "@scm-manager/ui-types";
type Props = {
changeset: Changeset
};
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>
);
}
}
}
export default ChangesetAuthor;