mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
so much answers feature wow
This commit is contained in:
parent
6497665819
commit
9e1acd23aa
@ -56,28 +56,29 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
status : ImmutablePropTypes.map.isRequired,
|
||||
relationship : ImmutablePropTypes.map,
|
||||
onReply : PropTypes.func,
|
||||
onFavourite : PropTypes.func,
|
||||
onReblog : PropTypes.func,
|
||||
onDelete : PropTypes.func,
|
||||
onDirect : PropTypes.func,
|
||||
onMention : PropTypes.func,
|
||||
onMute : PropTypes.func,
|
||||
onUnmute : PropTypes.func,
|
||||
onBlock : PropTypes.func,
|
||||
onUnblock : PropTypes.func,
|
||||
onBlockDomain : PropTypes.func,
|
||||
onUnblockDomain : PropTypes.func,
|
||||
onReport : PropTypes.func,
|
||||
onEmbed : PropTypes.func,
|
||||
onMuteConversation: PropTypes.func,
|
||||
onPin : PropTypes.func,
|
||||
onBookmark : PropTypes.func,
|
||||
withDismiss : PropTypes.bool,
|
||||
scrollKey : PropTypes.string,
|
||||
intl : PropTypes.object.isRequired,
|
||||
status : ImmutablePropTypes.map.isRequired,
|
||||
relationship : ImmutablePropTypes.map,
|
||||
onReply : PropTypes.func,
|
||||
onFavourite : PropTypes.func,
|
||||
onReblog : PropTypes.func,
|
||||
onDelete : PropTypes.func,
|
||||
onDirect : PropTypes.func,
|
||||
onMention : PropTypes.func,
|
||||
onMute : PropTypes.func,
|
||||
onUnmute : PropTypes.func,
|
||||
onBlock : PropTypes.func,
|
||||
onUnblock : PropTypes.func,
|
||||
onBlockDomain : PropTypes.func,
|
||||
onUnblockDomain : PropTypes.func,
|
||||
onReport : PropTypes.func,
|
||||
onEmbed : PropTypes.func,
|
||||
onMuteConversation : PropTypes.func,
|
||||
onPin : PropTypes.func,
|
||||
onBookmark : PropTypes.func,
|
||||
withDismiss : PropTypes.bool,
|
||||
enableSoMuchAnswersWow: PropTypes.bool,
|
||||
scrollKey : PropTypes.string,
|
||||
intl : PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
// Avoid checking props that are functions (and whose equality will always
|
||||
@ -230,7 +231,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
|
||||
let menu = [];
|
||||
|
||||
menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen , iconName: 'arrow-right' });
|
||||
menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen, iconName: 'arrow-right' });
|
||||
|
||||
if (publicStatus) {
|
||||
menu.push({ text: intl.formatMessage(messages.copy), action: this.handleCopy, iconName: 'copy' });
|
||||
@ -238,8 +239,8 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
}
|
||||
|
||||
menu.push({
|
||||
text : intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark),
|
||||
action: this.handleBookmarkClick,
|
||||
text : intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark),
|
||||
action : this.handleBookmarkClick,
|
||||
iconName: 'bookmark',
|
||||
});
|
||||
menu.push(null);
|
||||
@ -255,8 +256,8 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
if (status.getIn(['account', 'id']) === me) {
|
||||
if (publicStatus) {
|
||||
menu.push({
|
||||
text : intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin),
|
||||
action: this.handlePinClick,
|
||||
text : intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin),
|
||||
action : this.handlePinClick,
|
||||
iconName: 'gears',
|
||||
});
|
||||
}
|
||||
@ -265,48 +266,48 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick });
|
||||
} else {
|
||||
menu.push({
|
||||
text : intl.formatMessage(messages.mention, { name: account.get('username') }),
|
||||
action: this.handleMentionClick,
|
||||
text : intl.formatMessage(messages.mention, { name: account.get('username') }),
|
||||
action : this.handleMentionClick,
|
||||
iconName: 'plane',
|
||||
});
|
||||
menu.push({
|
||||
text : intl.formatMessage(messages.direct, { name: account.get('username') }),
|
||||
action: this.handleDirectClick,
|
||||
text : intl.formatMessage(messages.direct, { name: account.get('username') }),
|
||||
action : this.handleDirectClick,
|
||||
iconName: 'enveloppe-o',
|
||||
});
|
||||
menu.push(null);
|
||||
|
||||
if (relationship && relationship.get('muting')) {
|
||||
menu.push({
|
||||
text : intl.formatMessage(messages.unmute, { name: account.get('username') }),
|
||||
action: this.handleMuteClick,
|
||||
text : intl.formatMessage(messages.unmute, { name: account.get('username') }),
|
||||
action : this.handleMuteClick,
|
||||
iconName: 'times',
|
||||
});
|
||||
} else {
|
||||
menu.push({
|
||||
text : intl.formatMessage(messages.mute, { name: account.get('username') }),
|
||||
action: this.handleMuteClick,
|
||||
text : intl.formatMessage(messages.mute, { name: account.get('username') }),
|
||||
action : this.handleMuteClick,
|
||||
iconName: 'times',
|
||||
});
|
||||
}
|
||||
|
||||
if (relationship && relationship.get('blocking')) {
|
||||
menu.push({
|
||||
text : intl.formatMessage(messages.unblock, { name: account.get('username') }),
|
||||
action: this.handleBlockClick,
|
||||
text : intl.formatMessage(messages.unblock, { name: account.get('username') }),
|
||||
action : this.handleBlockClick,
|
||||
iconName: 'plus',
|
||||
});
|
||||
} else {
|
||||
menu.push({
|
||||
text : intl.formatMessage(messages.block, { name: account.get('username') }),
|
||||
action: this.handleBlockClick,
|
||||
text : intl.formatMessage(messages.block, { name: account.get('username') }),
|
||||
action : this.handleBlockClick,
|
||||
iconName: 'times',
|
||||
});
|
||||
}
|
||||
|
||||
menu.push({
|
||||
text : intl.formatMessage(messages.report, { name: account.get('username') }),
|
||||
action: this.handleReport,
|
||||
text : intl.formatMessage(messages.report, { name: account.get('username') }),
|
||||
action : this.handleReport,
|
||||
iconName: 'flag',
|
||||
});
|
||||
|
||||
@ -325,15 +326,15 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
if (isStaff) {
|
||||
menu.push(null);
|
||||
menu.push({
|
||||
text: intl.formatMessage(messages.admin_account,
|
||||
text : intl.formatMessage(messages.admin_account,
|
||||
{ name: account.get('username') }),
|
||||
href: `/admin/accounts/${status.getIn(['account', 'id'])}`,
|
||||
href : `/admin/accounts/${status.getIn(['account', 'id'])}`,
|
||||
iconName: 'gears',
|
||||
|
||||
});
|
||||
menu.push({
|
||||
text: intl.formatMessage(messages.admin_status),
|
||||
href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}`,
|
||||
text : intl.formatMessage(messages.admin_status),
|
||||
href : `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}`,
|
||||
iconName: 'menu',
|
||||
});
|
||||
}
|
||||
@ -370,6 +371,12 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
onClick={this.handleShareClick}
|
||||
/>
|
||||
);
|
||||
let countAnswers = status.get('replies_count') * 1;
|
||||
|
||||
const enableSoMuchAnswersWOW = true;
|
||||
if (enableSoMuchAnswersWOW) {
|
||||
countAnswers += Math.floor(Math.random() * Math.floor(500000));
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='status__action-bar'>
|
||||
@ -378,8 +385,8 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||
title={replyTitle}
|
||||
icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon}
|
||||
onClick={this.handleReplyClick}
|
||||
counter={status.get('replies_count')}
|
||||
obfuscateCount
|
||||
counter={countAnswers}
|
||||
obfuscateCount={false}
|
||||
/>
|
||||
<IconButton
|
||||
className={classNames('status__action-bar-button', { reblogPrivate })}
|
||||
|
@ -52,7 +52,7 @@ class ReplyIndicator extends ImmutablePureComponent {
|
||||
return (
|
||||
<div className='reply-indicator'>
|
||||
<div className='reply-indicator__header'>
|
||||
<div className='reply-indicator__cancel'><IconButton title={intl.formatMessage(messages.cancel)} icon='times' onClick={this.handleClick} inverted /></div>
|
||||
<div className='reply-indicator__cancel'><IconButton title={intl.formatMessage(messages.cancel)} icon='times' onClick={this.handleClick} inverted obfuscate='false' /></div>
|
||||
|
||||
<a href={status.getIn(['account', 'url'])} onClick={this.handleAccountClick} className='reply-indicator__display-name'>
|
||||
<div className='reply-indicator__display-avatar'><Avatar account={status.get('account')} size={24} /></div>
|
||||
|
@ -273,8 +273,8 @@ class ActionBar extends React.PureComponent {
|
||||
|
||||
return (
|
||||
<div className='detailed-status__action-bar'>
|
||||
<div className='detailed-status__button'><IconButton title={intl.formatMessage(messages.reply)} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} /></div>
|
||||
<div className='detailed-status__button' ><IconButton className={classNames({ reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} /></div>
|
||||
<div className='detailed-status__button button_reply'><IconButton title={intl.formatMessage(messages.reply)} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} /></div>
|
||||
<div className='detailed-status__button button_reblog' ><IconButton className={classNames({ reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} /></div>
|
||||
<div className='detailed-status__button'><IconButton className='star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} /></div>
|
||||
{shareButton}
|
||||
<div className='detailed-status__button'><IconButton className='bookmark-icon' active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} /></div>
|
||||
|
Loading…
Reference in New Issue
Block a user