mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
fix template account card
This commit is contained in:
parent
9598bce610
commit
242adcad79
@ -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 >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user