|
|
|
@ -164,13 +164,17 @@ class Header extends ImmutablePureComponent { |
|
|
|
|
info.push(<span key='domain_blocked' className='relationship-tag'><FormattedMessage id='account.domain_blocked' defaultMessage='Domain blocked' /></span>); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) { |
|
|
|
|
bellBtn = <IconButton icon='bell-o' size={24} active={account.getIn(['relationship', 'notifying'])} title={intl.formatMessage(account.getIn(['relationship', 'notifying']) ? messages.disableNotifications : messages.enableNotifications, { name: account.get('username') })} onClick={this.props.onNotifyToggle} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (me !== account.get('id')) { |
|
|
|
|
if (!account.get('relationship')) { // Wait until the relationship is loaded
|
|
|
|
|
actionBtn = ''; |
|
|
|
|
} else if (account.getIn(['relationship', 'requested'])) { |
|
|
|
|
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />; |
|
|
|
|
actionBtn = <Button className={classNames('logo-button', { 'button--with-bell': bellBtn !== '' })} text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />; |
|
|
|
|
} else if (!account.getIn(['relationship', 'blocking'])) { |
|
|
|
|
actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']) })} style={account.getIn(['relationship', 'following']) && { padding: '0 10px', 'min-width': '88px' }} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />; |
|
|
|
|
actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']), 'button--with-bell': bellBtn !== '' })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />; |
|
|
|
|
} else if (account.getIn(['relationship', 'blocking'])) { |
|
|
|
|
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.props.onBlock} />; |
|
|
|
|
} |
|
|
|
@ -178,10 +182,6 @@ class Header extends ImmutablePureComponent { |
|
|
|
|
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.edit_profile)} onClick={this.openEditProfile} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) { |
|
|
|
|
bellBtn = <IconButton icon='bell-o' size={24} active={account.getIn(['relationship', 'notifying'])} title={intl.formatMessage(account.getIn(['relationship', 'notifying']) ? messages.disableNotifications : messages.enableNotifications, { name: account.get('username') })} onClick={this.props.onNotifyToggle} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (account.get('moved') && !account.getIn(['relationship', 'following'])) { |
|
|
|
|
actionBtn = ''; |
|
|
|
|
} |
|
|
|
|