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 = ; - } else if (!account.getIn(['relationship', 'blocking'])) { - actionBtn = ; - } else if (account.getIn(['relationship', 'blocking'])) { - actionBtn = ; - } - } else { - actionBtn = ; - } - - return actionBtn; - }; - render() { const { account, intl, username, me } = this.props; const { isSmallScreen } = this.state; @@ -247,7 +218,6 @@ class Header extends ImmutablePureComponent { } const info = this.makeInfo(); - const actionBtn = this.getActionBtn(); const menu = this.makeMenu(); const headerMissing = (account.get('header').indexOf('/headers/original/missing.png') > -1); @@ -319,7 +289,7 @@ class Header extends ImmutablePureComponent { { me &&