// @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 { Button, OutlineButton } from 'src/components/button'; import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; import renderTextWithLinks from 'src/helpers/render-text-with-markdown-links'; import type { Dispatch } from 'redux'; import { withCurrentUser } from 'src/components/withCurrentUser'; import { HoverWrapper, ProfileCard, CoverContainer, CoverPhoto, ProfilePhotoContainer, Content, Title, Description, Actions, } from './style'; type ProfileProps = { community: GetCommunityType, dispatch: Dispatch, currentUser: ?Object, ref: (?HTMLElement) => void, style: CSSStyleDeclaration, }; class HoverProfile extends Component { render() { const { community, ref, style } = this.props; const { communityPermissions } = community; const { isOwner, isModerator } = communityPermissions; return ( {community.name} {community.description && ( {renderTextWithLinks(community.description)} )} {(isModerator || isOwner) && ( Settings )} ); } } export default compose( withCurrentUser, withRouter, connect() )(HoverProfile);