Removed domain blocks
• Removed: - domain blocks as we are not using any other domains than gab.com
This commit is contained in:
@@ -1,86 +0,0 @@
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import debounce from 'lodash.debounce'
|
||||
import { unblockDomain, fetchDomainBlocks, expandDomainBlocks } from '../actions/domain_blocks'
|
||||
import ColumnIndicator from '../components/column_indicator'
|
||||
import List from '../components/list'
|
||||
|
||||
const messages = defineMessages({
|
||||
heading: { id: 'column.domain_blocks', defaultMessage: 'Blocked domains' },
|
||||
unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' },
|
||||
emptyMessage: { id: 'empty_column.domain_blocks', defaultMessage: 'There are no blocked domains yet.' },
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onExpandDomainBlocks() {
|
||||
dispatch(expandDomainBlocks())
|
||||
},
|
||||
|
||||
onFetchDomainBlocks() {
|
||||
dispatch(fetchDomainBlocks())
|
||||
},
|
||||
|
||||
onUnblockDomain (domain) {
|
||||
dispatch(unblockDomain(domain))
|
||||
},
|
||||
})
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
domains: state.getIn(['domain_lists', 'blocks', 'items']),
|
||||
hasMore: !!state.getIn(['domain_lists', 'blocks', 'next']),
|
||||
})
|
||||
|
||||
export default
|
||||
@injectIntl
|
||||
@connect(mapStateToProps, mapDispatchToProps)
|
||||
class Blocks extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
hasMore: PropTypes.bool,
|
||||
domains: ImmutablePropTypes.orderedSet,
|
||||
onUnblockDomain: PropTypes.func.isRequired,
|
||||
onFetchDomainBlocks: PropTypes.func.isRequired,
|
||||
onExpandDomainBlocks: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.props.onFetchDomainBlocks()
|
||||
}
|
||||
|
||||
handleUnblockDomain = (domain) => {
|
||||
this.props.onUnblockDomain(domain)
|
||||
}
|
||||
|
||||
handleLoadMore = debounce(() => {
|
||||
this.props.onExpandDomainBlocks()
|
||||
}, 300, { leading: true })
|
||||
|
||||
render() {
|
||||
const { intl, domains, hasMore } = this.props
|
||||
|
||||
if (!domains) {
|
||||
return <ColumnIndicator type='loading' />
|
||||
}
|
||||
|
||||
const items = domains.map((domain) => {
|
||||
return {
|
||||
title: intl.formatMessage(messages.unblockDomain, { domain }),
|
||||
onClick: () => this.handleUnblockDomain(domain),
|
||||
hideArrow: true,
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<List
|
||||
scrollKey='domain_blocks'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
hasMore={hasMore}
|
||||
emptyMessage={intl.formatMessage(messages.emptyMessage)}
|
||||
items={items}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,7 @@ export function AccountTimeline() { return import(/* webpackChunkName: "features
|
||||
export function AccountGallery() { return import(/* webpackChunkName: "features/account_gallery" */'../../account_gallery') }
|
||||
export function ActionsModal() { return import(/* webpackChunkName: "components/actions_modal" */'../../../components/modal/actions_modal') }
|
||||
export function BlockAccountModal() { return import(/* webpackChunkName: "components/block_account_modal" */'../../../components/modal/block_account_modal') }
|
||||
export function BlockDomainModal() { return import(/* webpackChunkName: "components/block_domain_modal" */'../../../components/modal/block_domain_modal') }
|
||||
export function BlockedAccounts() { return import(/* webpackChunkName: "features/blocked_accounts" */'../../blocked_accounts') }
|
||||
export function BlockedDomains() { return import(/* webpackChunkName: "features/blocked_domains" */'../../blocked_domains') }
|
||||
export function BoostModal() { return import(/* webpackChunkName: "components/boost_modal" */'../../../components/modal/boost_modal') }
|
||||
export function CommentSortingOptionsPopover() { return import(/* webpackChunkName: "components/comment_sorting_options_popover" */'../../../components/popover/comment_sorting_options_popover') }
|
||||
export function CommunityTimeline() { return import(/* webpackChunkName: "features/community_timeline" */'../../community_timeline') }
|
||||
|
||||
Reference in New Issue
Block a user