diff --git a/app/soapbox/components/display_name.js b/app/soapbox/components/display_name.js index 1016c9f5a..30dbce9a2 100644 --- a/app/soapbox/components/display_name.js +++ b/app/soapbox/components/display_name.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import VerificationBadge from './verification_badge'; import { acctFull } from '../utils/accounts'; @@ -8,10 +9,11 @@ export default class DisplayName extends React.PureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired, others: ImmutablePropTypes.list, + children: PropTypes.node, }; render() { - const { account, others } = this.props; + const { account, others, children } = this.props; let displayName, suffix; @@ -40,6 +42,7 @@ export default class DisplayName extends React.PureComponent { {displayName} {suffix} + {children} ); } diff --git a/app/soapbox/components/status.js b/app/soapbox/components/status.js index 15c985e4b..b7b9a4fb1 100644 --- a/app/soapbox/components/status.js +++ b/app/soapbox/components/status.js @@ -18,6 +18,8 @@ import classNames from 'classnames'; import Icon from 'soapbox/components/icon'; import PollContainer from 'soapbox/containers/poll_container'; import { NavLink } from 'react-router-dom'; +import ProfileHoverCardContainer from '../features/profile_hover_card/profile_hover_card_container'; +import { isMobile } from '../../../app/soapbox/is_mobile'; // We use the component (and not the container) since we do not want // to use the progress bar to show download progress @@ -104,6 +106,7 @@ class Status extends ImmutablePureComponent { state = { showMedia: defaultMediaVisibility(this.props.status, this.props.displayMedia), statusId: undefined, + profileCardVisible: false, }; // Track height changes we know about to compensate scrolling @@ -249,6 +252,14 @@ class Status extends ImmutablePureComponent { this.handleToggleMediaVisibility(); } + handleProfileHover = e => { + if (!isMobile(window.innerWidth)) this.setState({ profileCardVisible: true }); + } + + handleProfileLeave = e => { + if (!isMobile(window.innerWidth)) this.setState({ profileCardVisible: false }); + } + _properStatus() { const { status } = this.props; @@ -437,6 +448,7 @@ class Status extends ImmutablePureComponent { }; const statusUrl = `/@${status.getIn(['account', 'acct'])}/posts/${status.get('id')}`; + const { profileCardVisible } = this.state; return ( @@ -450,13 +462,16 @@ class Status extends ImmutablePureComponent { - +
+ {statusAvatar}
- - - + + + + +
{!group && status.get('group') && ( diff --git a/app/soapbox/containers/account_container.js b/app/soapbox/containers/account_container.js index 8e1f067de..1e890a7e2 100644 --- a/app/soapbox/containers/account_container.js +++ b/app/soapbox/containers/account_container.js @@ -66,7 +66,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onMuteNotifications(account, notifications) { dispatch(muteAccount(account.get('id'), notifications)); }, diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index 038a33d6f..17ebb36b6 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -17,12 +17,9 @@ import DropdownMenuContainer from 'soapbox/containers/dropdown_menu_container'; import ProfileInfoPanel from '../../ui/components/profile_info_panel'; import { debounce } from 'lodash'; import StillImage from 'soapbox/components/still_image'; +import ActionButton from 'soapbox/features/ui/components/action_button'; const messages = defineMessages({ - unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, - follow: { id: 'account.follow', defaultMessage: 'Follow' }, - requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' }, - unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' }, linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' }, account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' }, @@ -65,8 +62,6 @@ class Header extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, identity_props: ImmutablePropTypes.list, - onFollow: PropTypes.func.isRequired, - onBlock: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, username: PropTypes.string, isStaff: PropTypes.bool.isRequired, @@ -199,30 +194,6 @@ class Header extends ImmutablePureComponent { return info; }; - getActionBtn() { - const { account, intl, me } = this.props; - - let actionBtn = null; - - if (!account || !me) return actionBtn; - - if (me !== account.get('id')) { - if (!account.get('relationship')) { // Wait until the relationship is loaded - // - } else if (account.getIn(['relationship', 'requested'])) { - actionBtn =