[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>
master
Mélanie Chauvel 4 years ago committed by Claire
parent 28f533f370
commit 0e7484209c
  1. 14
      app/javascript/flavours/glitch/components/status_action_bar.js
  2. 5
      app/javascript/flavours/glitch/features/status/components/action_bar.js

@ -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) {
menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
if (writtenByMe && publicStatus) {
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
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 || withDismiss) {
menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
menu.push(null);
}
if (writtenByMe) {
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick });
} else {

@ -147,6 +147,7 @@ class ActionBar extends React.PureComponent {
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 });

Loading…
Cancel
Save