acctFull --> getAcct throughout the UI, make it stateful
This commit is contained in:
@ -10,7 +10,8 @@ import Icon from 'soapbox/components/icon';
|
||||
import VerificationBadge from 'soapbox/components/verification_badge';
|
||||
import Badge from 'soapbox/components/badge';
|
||||
import { List as ImmutableList } from 'immutable';
|
||||
import { acctFull, isAdmin, isModerator } from 'soapbox/utils/accounts';
|
||||
import { getAcct, isAdmin, isModerator } from 'soapbox/utils/accounts';
|
||||
import { displayFqn } from 'soapbox/utils/state';
|
||||
import classNames from 'classnames';
|
||||
|
||||
const messages = defineMessages({
|
||||
@ -36,10 +37,11 @@ class ProfileInfoPanel extends ImmutablePureComponent {
|
||||
identity_proofs: ImmutablePropTypes.list,
|
||||
intl: PropTypes.object.isRequired,
|
||||
username: PropTypes.string,
|
||||
displayFqn: PropTypes.bool,
|
||||
};
|
||||
|
||||
render() {
|
||||
const { account, intl, identity_proofs, username } = this.props;
|
||||
const { account, displayFqn, intl, identity_proofs, username } = this.props;
|
||||
|
||||
if (!account) {
|
||||
return (
|
||||
@ -73,7 +75,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
|
||||
<span dangerouslySetInnerHTML={displayNameHtml} className='profile-info-panel__name-content' />
|
||||
{verified && <VerificationBadge />}
|
||||
{account.get('bot') && <Badge slug='bot' title={intl.formatMessage(messages.bot)} />}
|
||||
{ <small>@{acctFull(account)} {lockedIcon}</small> }
|
||||
{ <small>@{getAcct(account, displayFqn)} {lockedIcon}</small> }
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@ -144,6 +146,7 @@ const mapStateToProps = (state, { account }) => {
|
||||
return {
|
||||
identity_proofs,
|
||||
domain: state.getIn(['meta', 'domain']),
|
||||
displayFqn: displayFqn(state),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -8,7 +8,8 @@ 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 { acctFull } from 'soapbox/utils/accounts';
|
||||
import { getAcct } 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';
|
||||
@ -17,12 +18,13 @@ class UserPanel extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
account: ImmutablePropTypes.map,
|
||||
displayFqn: PropTypes.bool,
|
||||
intl: PropTypes.object.isRequired,
|
||||
domain: PropTypes.string,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { account, intl, domain } = this.props;
|
||||
const { account, displayFqn, intl, domain } = this.props;
|
||||
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');
|
||||
@ -49,7 +51,7 @@ class UserPanel extends ImmutablePureComponent {
|
||||
<Link to={`/@${account.get('acct')}`}>
|
||||
<span className='user-panel__account__name' dangerouslySetInnerHTML={displayNameHtml} />
|
||||
{verified && <VerificationBadge />}
|
||||
<small className='user-panel__account__username'>@{acctFull(account)}</small>
|
||||
<small className='user-panel__account__username'>@{getAcct(account, displayFqn)}</small>
|
||||
</Link>
|
||||
</h1>
|
||||
</div>
|
||||
@ -93,6 +95,7 @@ const makeMapStateToProps = () => {
|
||||
|
||||
const mapStateToProps = (state, { accountId }) => ({
|
||||
account: getAccount(state, accountId),
|
||||
displayFqn: displayFqn(state),
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
|
||||
Reference in New Issue
Block a user