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