// @flow import React, { Component } from 'react'; import compose from 'recompose/compose'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import AvatarImage from 'src/components/avatar/image'; import { Link } from 'react-router-dom'; import Badge from 'src/components/badges'; import { OutlineButton } from 'src/components/button'; import ConditionalWrap from 'src/components/conditionalWrap'; import type { GetUserType } from 'shared/graphql/queries/user/getUser'; import type { Dispatch } from 'redux'; import renderTextWithLinks from 'src/helpers/render-text-with-markdown-links'; import { withCurrentUser } from 'src/components/withCurrentUser'; import { HoverWrapper, ProfileCard, CoverContainer, CoverPhoto, ProfilePhotoContainer, Content, Title, Username, Description, Actions, } from './style'; type ProfileProps = { user: GetUserType, dispatch: Dispatch, currentUser: ?Object, ref: (?HTMLElement) => void, style: CSSStyleDeclaration, }; class HoverProfile extends Component { render() { const { user, currentUser, ref, style } = this.props; const me = currentUser && currentUser.id === user.id; return ( ( {children} )} > ( {children} )} > {user.name} @{user.username} {user.betaSupporter && ( )} {user.description && ( {renderTextWithLinks(user.description)} )} {me && My profile} ); } } export default compose( withCurrentUser, withRouter, connect() )(HoverProfile);