Accounts: call isVerified in the places it's missing

merge-requests/784/head
Alex Gleason 3 years ago
parent 1be73d13a1
commit 5f7a201f08
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -2,10 +2,9 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { getAcct } from 'soapbox/utils/accounts';
import { getAcct, isVerified } from 'soapbox/utils/accounts';
import StillImage from 'soapbox/components/still_image';
import VerificationBadge from 'soapbox/components/verification_badge';
import { List as ImmutableList } from 'immutable';
import { displayFqn } from 'soapbox/utils/state';
const mapStateToProps = state => ({
@ -27,7 +26,7 @@ const ProfilePreview = ({ account, displayFqn }) => (
<bdi>
<strong className='emojify p-name'>
{account.get('display_name')}
{account.getIn(['pleroma', 'tags'], ImmutableList()).includes('verified') && <VerificationBadge />}
{isVerified(account) && <VerificationBadge />}
</strong>
</bdi>
<span>@{getAcct(account, displayFqn)}</span>

@ -8,11 +8,10 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import Avatar from 'soapbox/components/avatar';
import { shortNumberFormat } from 'soapbox/utils/numbers';
import { getAcct } from 'soapbox/utils/accounts';
import { getAcct, isVerified } from 'soapbox/utils/accounts';
import { displayFqn } from 'soapbox/utils/state';
import StillImage from 'soapbox/components/still_image';
import VerificationBadge from 'soapbox/components/verification_badge';
import { List as ImmutableList } from 'immutable';
class UserPanel extends ImmutablePureComponent {
@ -28,7 +27,6 @@ class UserPanel extends ImmutablePureComponent {
if (!account) return null;
const displayNameHtml = { __html: account.get('display_name_html') };
const acct = account.get('acct').indexOf('@') === -1 && domain ? `${account.get('acct')}@${domain}` : account.get('acct');
const verified = account.getIn(['pleroma', 'tags'], ImmutableList()).includes('verified');
const header = account.get('header');
return (
@ -51,7 +49,7 @@ class UserPanel extends ImmutablePureComponent {
<h1>
<Link to={`/@${account.get('acct')}`}>
<span className='user-panel__account__name' dangerouslySetInnerHTML={displayNameHtml} />
{verified && <VerificationBadge />}
{isVerified(account) && <VerificationBadge />}
<small className='user-panel__account__username'>@{getAcct(account, displayFqn)}</small>
</Link>
</h1>

Loading…
Cancel
Save