Scaffold filters section

This commit is contained in:
Alex Gleason 2020-04-25 18:27:37 -05:00
parent baec6d3fd8
commit 7b02e1a823
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,42 @@
import React from 'react';
import { connect } from 'react-redux';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
import Column from '../ui/components/column';
import { fetchFilters } from '../../actions/filters';
const messages = defineMessages({
heading: { id: 'column.filters', defaultMessage: 'Muted words' },
});
const mapStateToProps = state => ({
filters: state.get('filters'),
});
export default @connect(mapStateToProps)
@injectIntl
class Filters extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
componentWillMount() {
this.props.dispatch(fetchFilters());
}
render() {
const { intl } = this.props;
const emptyMessage = <FormattedMessage id='empty_column.filters' defaultMessage="You haven't created any muted words yet." />;
return (
<Column icon='filter' heading={intl.formatMessage(messages.heading)} backBtnSlim>
{emptyMessage}
</Column>
);
}
}

View file

@ -54,6 +54,7 @@ import {
Blocks,
DomainBlocks,
Mutes,
Filters,
PinnedStatuses,
Search,
// Explore,
@ -223,6 +224,7 @@ class SwitchingColumnsArea extends React.PureComponent {
<WrappedRoute path='/blocks' layout={LAYOUT.DEFAULT} component={Blocks} content={children} />
<WrappedRoute path='/domain_blocks' layout={LAYOUT.DEFAULT} component={DomainBlocks} content={children} />
<WrappedRoute path='/mutes' layout={LAYOUT.DEFAULT} component={Mutes} content={children} />
<WrappedRoute path='/filters' layout={LAYOUT.DEFAULT} component={Filters} content={children} />
<WrappedRoute path='/@:username' publicRoute exact component={AccountTimeline} page={ProfilePage} content={children} />
<WrappedRoute path='/@:username/with_replies' component={AccountTimeline} page={ProfilePage} content={children} componentParams={{ withReplies: true }} />
<WrappedRoute path='/@:username/followers' component={Followers} page={ProfilePage} content={children} />

View file

@ -126,6 +126,10 @@ export function MuteModal() {
return import(/* webpackChunkName: "modals/mute_modal" */'../components/mute_modal');
}
export function Filters() {
return import(/* webpackChunkName: "features/filters" */'../../filters');
}
export function ReportModal() {
return import(/* webpackChunkName: "modals/report_modal" */'../components/report_modal');
}