2018-12-19 13:28:04 +01:00
|
|
|
// @flow
|
|
|
|
|
import React from "react";
|
|
|
|
|
import type { Me } from "@scm-manager/ui-types";
|
2018-12-19 15:09:40 +01:00
|
|
|
import { MailLink, AvatarWrapper, AvatarImage } from "@scm-manager/ui-components";
|
2018-12-19 13:28:04 +01:00
|
|
|
import { compose } from "redux";
|
|
|
|
|
import { translate } from "react-i18next";
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
me: Me,
|
|
|
|
|
|
|
|
|
|
// Context props
|
|
|
|
|
t: string => string
|
|
|
|
|
};
|
|
|
|
|
type State = {};
|
|
|
|
|
|
|
|
|
|
class ProfileInfo extends React.Component<Props, State> {
|
|
|
|
|
render() {
|
|
|
|
|
const { me, t } = this.props;
|
|
|
|
|
return (
|
2018-12-19 15:09:40 +01:00
|
|
|
<div className="media">
|
2018-12-19 13:28:04 +01:00
|
|
|
<AvatarWrapper>
|
2018-12-19 15:09:40 +01:00
|
|
|
<figure className="media-left">
|
|
|
|
|
<p className="image is-64x64">
|
|
|
|
|
<AvatarImage person={ me }/>
|
|
|
|
|
</p>
|
|
|
|
|
</figure>
|
2018-12-19 13:28:04 +01:00
|
|
|
</AvatarWrapper>
|
2018-12-19 15:09:40 +01:00
|
|
|
<div className="media-content">
|
|
|
|
|
<table className="table">
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td className="has-text-weight-semibold">{t("profile.username")}</td>
|
|
|
|
|
<td>{me.name}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td className="has-text-weight-semibold">{t("profile.displayName")}</td>
|
|
|
|
|
<td>{me.displayName}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td className="has-text-weight-semibold">{t("profile.mail")}</td>
|
|
|
|
|
<td>
|
|
|
|
|
<MailLink address={me.mail} />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-12-19 13:28:04 +01:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default compose(translate("commons"))(ProfileInfo);
|