diff --git a/app/soapbox/features/profile_hover_card/profile_hover_card_container.js b/app/soapbox/features/profile_hover_card/profile_hover_card_container.js deleted file mode 100644 index d4f706212..000000000 --- a/app/soapbox/features/profile_hover_card/profile_hover_card_container.js +++ /dev/null @@ -1,79 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { makeGetAccount } from '../../selectors'; -import { injectIntl, FormattedMessage } from 'react-intl'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import UserPanel from '../ui/components/user_panel'; -import ActionButton from '../ui/components/action_button'; -import { isAdmin, isModerator } from 'soapbox/utils/accounts'; -import Badge from 'soapbox/components/badge'; -import classNames from 'classnames'; -import { fetchRelationships } from 'soapbox/actions/accounts'; - -const getAccount = makeGetAccount(); - -const mapStateToProps = (state, { accountId }) => { - return { - account: getAccount(state, accountId), - }; -}; - -export default @connect(mapStateToProps) -@injectIntl -class ProfileHoverCardContainer extends ImmutablePureComponent { - - static propTypes = { - visible: PropTypes.bool, - accountId: PropTypes.string, - account: ImmutablePropTypes.map, - intl: PropTypes.object.isRequired, - dispatch: PropTypes.func.isRequired, - } - - static defaultProps = { - visible: true, - } - - getBadges = () => { - const { account } = this.props; - let badges = []; - if (isAdmin(account)) badges.push(); - if (isModerator(account)) badges.push(); - if (account.getIn(['patron', 'is_patron'])) badges.push(); - return badges; - } - - componentDidMount() { - this.props.dispatch(fetchRelationships([this.props.accountId])); - } - - render() { - const { visible, accountId, account } = this.props; - if (!accountId) return null; - const accountBio = { __html: account.get('note_emojified') }; - const followedBy = account.getIn(['relationship', 'followed_by']); - const badges = this.getBadges(); - - return ( -
-
- {followedBy && - - - } -
- - {badges.length > 0 && -
- {badges} -
} - {account.getIn(['source', 'note'], '').length > 0 && -
} -
-
- ); - } - -};