AccountHeader: remove deactivate/delete options
This commit is contained in:
parent
5d30a8772d
commit
6d70989ef5
|
@ -10,7 +10,6 @@ import { launchChat } from 'soapbox/actions/chats';
|
||||||
import { mentionCompose, directCompose } from 'soapbox/actions/compose';
|
import { mentionCompose, directCompose } from 'soapbox/actions/compose';
|
||||||
import { blockDomain, unblockDomain } from 'soapbox/actions/domain_blocks';
|
import { blockDomain, unblockDomain } from 'soapbox/actions/domain_blocks';
|
||||||
import { openModal } from 'soapbox/actions/modals';
|
import { openModal } from 'soapbox/actions/modals';
|
||||||
import { deactivateUserModal } from 'soapbox/actions/moderation';
|
|
||||||
import { initMuteModal } from 'soapbox/actions/mutes';
|
import { initMuteModal } from 'soapbox/actions/mutes';
|
||||||
import { initReport } from 'soapbox/actions/reports';
|
import { initReport } from 'soapbox/actions/reports';
|
||||||
import { setSearchAccount } from 'soapbox/actions/search';
|
import { setSearchAccount } from 'soapbox/actions/search';
|
||||||
|
@ -57,8 +56,6 @@ const messages = defineMessages({
|
||||||
removeFromFollowers: { id: 'account.remove_from_followers', defaultMessage: 'Remove this follower' },
|
removeFromFollowers: { id: 'account.remove_from_followers', defaultMessage: 'Remove this follower' },
|
||||||
adminAccount: { id: 'status.admin_account', defaultMessage: 'Moderate @{name}' },
|
adminAccount: { id: 'status.admin_account', defaultMessage: 'Moderate @{name}' },
|
||||||
add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },
|
add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },
|
||||||
deactivateUser: { id: 'admin.users.actions.deactivate_user', defaultMessage: 'Deactivate @{name}' },
|
|
||||||
deleteUser: { id: 'admin.users.actions.delete_user', defaultMessage: 'Delete @{name}' },
|
|
||||||
search: { id: 'account.search', defaultMessage: 'Search from @{name}' },
|
search: { id: 'account.search', defaultMessage: 'Search from @{name}' },
|
||||||
searchSelf: { id: 'account.search_self', defaultMessage: 'Search your posts' },
|
searchSelf: { id: 'account.search_self', defaultMessage: 'Search your posts' },
|
||||||
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
|
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
|
||||||
|
@ -185,10 +182,6 @@ const Header: React.FC<IHeader> = ({ account }) => {
|
||||||
dispatch(launchChat(account.id, history));
|
dispatch(launchChat(account.id, history));
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDeactivateUser = () => {
|
|
||||||
dispatch(deactivateUserModal(intl, account.id));
|
|
||||||
};
|
|
||||||
|
|
||||||
const onModerate = () => {
|
const onModerate = () => {
|
||||||
dispatch(openModal('ACCOUNT_MODERATION', { accountId: account.id }));
|
dispatch(openModal('ACCOUNT_MODERATION', { accountId: account.id }));
|
||||||
};
|
};
|
||||||
|
@ -445,18 +438,6 @@ const Header: React.FC<IHeader> = ({ account }) => {
|
||||||
icon: require('@tabler/icons/gavel.svg'),
|
icon: require('@tabler/icons/gavel.svg'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account.id !== ownAccount?.id) {
|
|
||||||
menu.push({
|
|
||||||
text: intl.formatMessage(messages.deactivateUser, { name: account.username }),
|
|
||||||
action: onDeactivateUser,
|
|
||||||
icon: require('@tabler/icons/user-off.svg'),
|
|
||||||
});
|
|
||||||
menu.push({
|
|
||||||
text: intl.formatMessage(messages.deleteUser, { name: account.username }),
|
|
||||||
icon: require('@tabler/icons/user-minus.svg'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
|
|
Loading…
Reference in New Issue