// @flow import React from "react"; import type { Me } from "@scm-manager/ui-types"; import { MailLink, AvatarWrapper, AvatarImage } from "@scm-manager/ui-components"; import { compose } from "redux"; import { translate } from "react-i18next"; import injectSheet from "react-jss"; type Props = { me: Me, // Context props classes: any, t: string => string }; const styles = { spacing: { padding: "0 !important" } }; class ProfileInfo extends React.Component { render() { const { me, t } = this.props; return (

{this.renderGroups()}
{t("profile.username")} {me.name}
{t("profile.displayName")} {me.displayName}
{t("profile.mail")}
); } renderGroups() { const { me, t, classes } = this.props; let groups = null; if (me.groups.length > 0) { groups = ( {t("profile.groups")} ); } return groups; } } export default compose( injectSheet(styles), translate("commons") )(ProfileInfo);