fix template account card

This commit is contained in:
tykayn 2021-05-24 11:12:27 +02:00 committed by Baptiste Lemoine
parent 9598bce610
commit 242adcad79

View File

@ -9,14 +9,14 @@ import DisplayName from 'mastodon/components/display_name';
import Permalink from 'mastodon/components/permalink'; import Permalink from 'mastodon/components/permalink';
import RelativeTimestamp from 'mastodon/components/relative_timestamp'; import RelativeTimestamp from 'mastodon/components/relative_timestamp';
import IconButton from 'mastodon/components/icon_button'; import IconButton from 'mastodon/components/icon_button';
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
import { autoPlayGif, me, unfollowModal } from 'mastodon/initial_state'; import { autoPlayGif, me, unfollowModal } from 'mastodon/initial_state';
import ShortNumber from 'mastodon/components/short_number'; import ShortNumber from 'mastodon/components/short_number';
import { import {
followAccount,
unfollowAccount,
blockAccount, blockAccount,
followAccount,
unblockAccount, unblockAccount,
unfollowAccount,
unmuteAccount, unmuteAccount,
} from 'mastodon/actions/accounts'; } from 'mastodon/actions/accounts';
import { openModal } from 'mastodon/actions/modal'; import { openModal } from 'mastodon/actions/modal';
@ -89,8 +89,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}, },
}); });
export default export default @injectIntl
@injectIntl
@connect(makeMapStateToProps, mapDispatchToProps) @connect(makeMapStateToProps, mapDispatchToProps)
class AccountCard extends ImmutablePureComponent { class AccountCard extends ImmutablePureComponent {
@ -113,7 +112,7 @@ class AccountCard extends ImmutablePureComponent {
let emoji = emojis[i]; let emoji = emojis[i];
emoji.src = emoji.getAttribute('data-original'); emoji.src = emoji.getAttribute('data-original');
} }
} };
handleMouseLeave = ({ currentTarget }) => { handleMouseLeave = ({ currentTarget }) => {
if (autoPlayGif) { if (autoPlayGif) {
@ -126,7 +125,7 @@ class AccountCard extends ImmutablePureComponent {
let emoji = emojis[i]; let emoji = emojis[i];
emoji.src = emoji.getAttribute('data-static'); emoji.src = emoji.getAttribute('data-static');
} }
} };
handleFollow = () => { handleFollow = () => {
this.props.onFollow(this.props.account); this.props.onFollow(this.props.account);
@ -217,7 +216,10 @@ class AccountCard extends ImmutablePureComponent {
href={account.get('url')} href={account.get('url')}
to={`/accounts/${account.get('id')}`} to={`/accounts/${account.get('id')}`}
> >
<Avatar account={account} size={48} /> <Avatar
account={account}
size={48}
/>
<DisplayName account={account} /> <DisplayName account={account} />
</Permalink > </Permalink >
@ -226,7 +228,11 @@ class AccountCard extends ImmutablePureComponent {
</div > </div >
</div > </div >
<div className='directory__card__extra' onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}> <div
className='directory__card__extra'
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
>
<div <div
className='account__header__content translate' className='account__header__content translate'
dangerouslySetInnerHTML={{ __html: account.get('note_emojified') }} dangerouslySetInnerHTML={{ __html: account.get('note_emojified') }}
@ -237,7 +243,10 @@ class AccountCard extends ImmutablePureComponent {
<div className='accounts-table__count'> <div className='accounts-table__count'>
<ShortNumber value={account.get('statuses_count')} /> <ShortNumber value={account.get('statuses_count')} />
<small > <small >
<FormattedMessage id='account.posts' defaultMessage='Toots' /> <FormattedMessage
id='account.posts'
defaultMessage='Toots'
/>
</small > </small >
</div > </div >
<div className='accounts-table__count'> <div className='accounts-table__count'>
@ -267,6 +276,8 @@ class AccountCard extends ImmutablePureComponent {
</div > </div >
</div > </div >
</div > </div >
</div >
</div >
); );
} }