[Glitch] Slightly reorder three dots menu on toots to make it more intuitive

Port f5fefdc11a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
signup-info-prompt
Mélanie Chauvel 2021-02-11 01:05:04 +01:00 committed by Claire
parent 28f533f370
commit 0e7484209c
2 changed files with 13 additions and 10 deletions

View File

@ -193,9 +193,10 @@ class StatusActionBar extends ImmutablePureComponent {
render () {
const { status, intl, withDismiss, showReplyCount, directMessage, scrollKey } = this.props;
const mutingConversation = status.get('muted');
const anonymousAccess = !me;
const mutingConversation = status.get('muted');
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
const writtenByMe = status.getIn(['account', 'id']) === me;
let menu = [];
let reblogIcon = 'retweet';
@ -211,16 +212,17 @@ class StatusActionBar extends ImmutablePureComponent {
menu.push(null);
if (status.getIn(['account', 'id']) === me || withDismiss) {
if (writtenByMe && publicStatus) {
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
menu.push(null);
}
if (writtenByMe || withDismiss) {
menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
menu.push(null);
}
if (status.getIn(['account', 'id']) === me) {
if (publicStatus) {
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
}
if (writtenByMe) {
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick });
} else {

View File

@ -145,8 +145,9 @@ class ActionBar extends React.PureComponent {
render () {
const { status, intl } = this.props;
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
const mutingConversation = status.get('muted');
const writtenByMe = status.getIn(['account', 'id']) === me;
let menu = [];
@ -156,12 +157,12 @@ class ActionBar extends React.PureComponent {
menu.push(null);
}
if (me === status.getIn(['account', 'id'])) {
if (writtenByMe) {
if (publicStatus) {
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
menu.push(null);
}
menu.push(null);
menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
menu.push(null);
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });