Removed domain blocks
• Removed: - domain blocks as we are not using any other domains than gab.com
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
import { injectIntl, defineMessages } from 'react-intl'
|
||||
import { blockDomain } from '../../actions/domain_blocks'
|
||||
import ConfirmationModal from './confirmation_modal'
|
||||
|
||||
const messages = defineMessages({
|
||||
blockDomain: { id: 'block_domain', defaultMessage: 'Block {domain}' },
|
||||
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Block entire domain' },
|
||||
blockDomainMessage: { id: 'confirmations.domain_block.message', defaultMessage: 'Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable. You will not see content from that domain in any public timelines or your notifications. Your followers from that domain will be removed.' },
|
||||
cancel: { id: 'confirmation_modal.cancel', defaultMessage: 'Cancel' },
|
||||
})
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onConfirm: (domain) => dispatch(blockDomain(domain)),
|
||||
})
|
||||
|
||||
export default
|
||||
@connect(null, mapDispatchToProps)
|
||||
@injectIntl
|
||||
class BlockDomainModal extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
domain: PropTypes.string.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
onConfirm: PropTypes.func.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
this.props.onConfirm(this.props.domain)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { onClose, domain, intl } = this.props
|
||||
|
||||
return (
|
||||
<ConfirmationModal
|
||||
title={intl.formatMessage(messages.blockDomain, { domain })}
|
||||
message={intl.formatMessage(messages.blockDomainMessage, { domain })}
|
||||
confirm={intl.formatMessage(messages.blockDomainConfirm)}
|
||||
onConfirm={this.handleClick}
|
||||
onClose={onClose}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import BundleModalError from '../bundle_modal_error'
|
||||
import {
|
||||
MODAL_ACTIONS,
|
||||
MODAL_BLOCK_ACCOUNT,
|
||||
MODAL_BLOCK_DOMAIN,
|
||||
MODAL_BOOST,
|
||||
MODAL_COMMUNITY_TIMELINE_SETTINGS,
|
||||
MODAL_COMPOSE,
|
||||
@@ -41,7 +40,6 @@ import {
|
||||
import {
|
||||
ActionsModal,
|
||||
BlockAccountModal,
|
||||
BlockDomainModal,
|
||||
BoostModal,
|
||||
CommunityTimelineSettingsModal,
|
||||
ComposeModal,
|
||||
@@ -76,7 +74,6 @@ import {
|
||||
const MODAL_COMPONENTS = {}
|
||||
MODAL_COMPONENTS[MODAL_ACTIONS] = ActionsModal
|
||||
MODAL_COMPONENTS[MODAL_BLOCK_ACCOUNT] = BlockAccountModal
|
||||
MODAL_COMPONENTS[MODAL_BLOCK_DOMAIN] = BlockDomainModal
|
||||
MODAL_COMPONENTS[MODAL_BOOST] = BoostModal
|
||||
MODAL_COMPONENTS[MODAL_COMMUNITY_TIMELINE_SETTINGS] = CommunityTimelineSettingsModal
|
||||
MODAL_COMPONENTS[MODAL_COMPOSE] = ComposeModal
|
||||
@@ -109,7 +106,6 @@ MODAL_COMPONENTS[MODAL_VIDEO] = VideoModal
|
||||
|
||||
const CENTERED_XS_MODALS = [
|
||||
MODAL_BLOCK_ACCOUNT,
|
||||
MODAL_BLOCK_DOMAIN,
|
||||
MODAL_CONFIRM,
|
||||
MODAL_GROUP_DELETE,
|
||||
MODAL_LIST_DELETE,
|
||||
|
||||
@@ -15,7 +15,6 @@ import { muteAccount } from '../../actions/accounts'
|
||||
import { initReport } from '../../actions/reports'
|
||||
import { openModal } from '../../actions/modal'
|
||||
import { closePopover } from '../../actions/popover'
|
||||
import { blockDomain, unblockDomain } from '../../actions/domain_blocks'
|
||||
import { unfollowModal, autoPlayGif, me, isStaff } from '../../initial_state'
|
||||
import { makeGetAccount } from '../../selectors'
|
||||
import PopoverLayout from './popover_layout'
|
||||
@@ -24,7 +23,6 @@ import List from '../list'
|
||||
|
||||
const messages = defineMessages({
|
||||
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
|
||||
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Block entire domain' },
|
||||
blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },
|
||||
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },
|
||||
follow: { id: 'account.follow', defaultMessage: 'Follow' },
|
||||
@@ -40,20 +38,16 @@ const messages = defineMessages({
|
||||
report: { id: 'account.report', defaultMessage: 'Report @{name}' },
|
||||
share: { id: 'account.share', defaultMessage: 'Share @{name}\'s profile' },
|
||||
media: { id: 'account.media', defaultMessage: 'Media' },
|
||||
blockDomain: { id: 'account.block_domain', defaultMessage: 'Block domain {domain}' },
|
||||
unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' },
|
||||
hideReposts: { id: 'account.hide_reblogs', defaultMessage: 'Hide reposts from @{name}' },
|
||||
showReposts: { id: 'account.show_reblogs', defaultMessage: 'Show reposts from @{name}' },
|
||||
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
|
||||
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
|
||||
domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Blocked domains' },
|
||||
mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
|
||||
admin_account: { id: 'admin_account', defaultMessage: 'Open moderation interface' },
|
||||
add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },
|
||||
add_or_remove_from_shortcuts: { id: 'account.add_or_remove_from_shortcuts', defaultMessage: 'Add or Remove from shortcuts' },
|
||||
accountBlocked: { id: 'account.blocked', defaultMessage: 'Blocked' },
|
||||
accountMuted: { id: 'account.muted', defaultMessage: 'Muted' },
|
||||
domainBlocked: { id: 'account.domain_blocked', defaultMessage: 'Domain hidden' },
|
||||
});
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
@@ -61,7 +55,6 @@ const makeMapStateToProps = () => {
|
||||
|
||||
const mapStateToProps = (state, { account }) => ({
|
||||
account: getAccount(state, !!account ? account.get('id') : -1),
|
||||
domain: state.getIn(['meta', 'domain']),
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
@@ -125,18 +118,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
}
|
||||
},
|
||||
|
||||
onBlockDomain(domain) {
|
||||
dispatch(closePopover())
|
||||
dispatch(openModal('BLOCK_DOMAIN', {
|
||||
domain,
|
||||
}));
|
||||
},
|
||||
|
||||
onUnblockDomain(domain) {
|
||||
dispatch(closePopover())
|
||||
dispatch(unblockDomain(domain));
|
||||
},
|
||||
|
||||
onAddToList(account) {
|
||||
dispatch(closePopover())
|
||||
dispatch(openModal('LIST_ADDER', {
|
||||
@@ -157,7 +138,7 @@ class ProfileOptionsPopover extends PureComponent {
|
||||
}
|
||||
|
||||
makeMenu() {
|
||||
const { account, intl, domain } = this.props;
|
||||
const { account, intl } = this.props;
|
||||
|
||||
let menu = [];
|
||||
|
||||
@@ -219,20 +200,6 @@ class ProfileOptionsPopover extends PureComponent {
|
||||
onClick: this.handleReport
|
||||
})
|
||||
|
||||
if (account.get('acct') !== account.get('username')) {
|
||||
const domain = account.get('acct').split('@')[1];
|
||||
|
||||
const isBlockingDomain = account.getIn(['relationship', 'domain_blocking'])
|
||||
menu.push({
|
||||
hideArrow: true,
|
||||
icon: 'block',
|
||||
title: intl.formatMessage(isBlockingDomain ? messages.unblockDomain : messages.blockDomain, {
|
||||
domain,
|
||||
}),
|
||||
onClick: isBlockingDomain ? this.handleUnblockDomain : this.handleBlockDomain,
|
||||
})
|
||||
}
|
||||
|
||||
menu.push({
|
||||
hideArrow: true,
|
||||
icon: 'list',
|
||||
@@ -287,24 +254,6 @@ class ProfileOptionsPopover extends PureComponent {
|
||||
this.props.onMute(this.props.account);
|
||||
}
|
||||
|
||||
handleBlockDomain = () => {
|
||||
const domain = this.props.account.get('acct').split('@')[1]
|
||||
|
||||
// : todo : alert
|
||||
if (!domain) return
|
||||
|
||||
this.props.onBlockDomain(domain)
|
||||
}
|
||||
|
||||
handleUnblockDomain = () => {
|
||||
const domain = this.props.account.get('acct').split('@')[1];
|
||||
|
||||
// : todo : alert
|
||||
if (!domain) return;
|
||||
|
||||
this.props.onUnblockDomain(domain);
|
||||
}
|
||||
|
||||
handleAddToList = () => {
|
||||
this.props.onAddToList(this.props.account);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ const messages = defineMessages({
|
||||
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
|
||||
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
|
||||
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
|
||||
domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Blocked domains' },
|
||||
mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
|
||||
filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },
|
||||
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
|
||||
|
||||
@@ -26,7 +26,6 @@ const messages = defineMessages({
|
||||
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
|
||||
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
|
||||
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
|
||||
domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },
|
||||
mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
|
||||
filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },
|
||||
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
|
||||
@@ -156,12 +155,6 @@ class SidebarXS extends ImmutablePureComponent {
|
||||
// title: intl.formatMessage(messages.blocks),
|
||||
// },
|
||||
// {
|
||||
// icon: 'website',
|
||||
// to: '/settings/domain_blocks',
|
||||
// onClick: this.handleSidebarClose,
|
||||
// title: intl.formatMessage(messages.domain_blocks),
|
||||
// },
|
||||
// {
|
||||
// icon: 'audio-mute',
|
||||
// to: '/mutes',
|
||||
// onClick: this.handleSidebarClose,
|
||||
|
||||
Reference in New Issue
Block a user