Scaffold filters section
This commit is contained in:
parent
baec6d3fd8
commit
7b02e1a823
3 changed files with 48 additions and 0 deletions
42
app/gabsocial/features/filters/index.js
Normal file
42
app/gabsocial/features/filters/index.js
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -54,6 +54,7 @@ import {
|
||||||
Blocks,
|
Blocks,
|
||||||
DomainBlocks,
|
DomainBlocks,
|
||||||
Mutes,
|
Mutes,
|
||||||
|
Filters,
|
||||||
PinnedStatuses,
|
PinnedStatuses,
|
||||||
Search,
|
Search,
|
||||||
// Explore,
|
// Explore,
|
||||||
|
@ -223,6 +224,7 @@ class SwitchingColumnsArea extends React.PureComponent {
|
||||||
<WrappedRoute path='/blocks' layout={LAYOUT.DEFAULT} component={Blocks} content={children} />
|
<WrappedRoute path='/blocks' layout={LAYOUT.DEFAULT} component={Blocks} content={children} />
|
||||||
<WrappedRoute path='/domain_blocks' layout={LAYOUT.DEFAULT} component={DomainBlocks} 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='/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' 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/with_replies' component={AccountTimeline} page={ProfilePage} content={children} componentParams={{ withReplies: true }} />
|
||||||
<WrappedRoute path='/@:username/followers' component={Followers} page={ProfilePage} content={children} />
|
<WrappedRoute path='/@:username/followers' component={Followers} page={ProfilePage} content={children} />
|
||||||
|
|
|
@ -126,6 +126,10 @@ export function MuteModal() {
|
||||||
return import(/* webpackChunkName: "modals/mute_modal" */'../components/mute_modal');
|
return import(/* webpackChunkName: "modals/mute_modal" */'../components/mute_modal');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function Filters() {
|
||||||
|
return import(/* webpackChunkName: "features/filters" */'../../filters');
|
||||||
|
}
|
||||||
|
|
||||||
export function ReportModal() {
|
export function ReportModal() {
|
||||||
return import(/* webpackChunkName: "modals/report_modal" */'../components/report_modal');
|
return import(/* webpackChunkName: "modals/report_modal" */'../components/report_modal');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue