Added BlockedUsers, MutedUsers pages. Updated Settings

• Added:
- BlockedUsers, MutedUsers pages

• Updated:
- SettingsPage, SettingsLayout
This commit is contained in:
mgabdev
2020-06-10 12:08:31 -04:00
parent 7c32c3e2ee
commit f9a087ca14
5 changed files with 175 additions and 54 deletions

View File

@@ -6,10 +6,12 @@ import { me } from '../initial_state'
import { fetchBlocks, expandBlocks } from '../actions/blocks'
import Account from '../components/account'
import Block from '../components/block'
import Heading from '../components/heading'
import ScrollableList from '../components/scrollable_list'
const messages = defineMessages({
empty: { id: 'empty_column.blocks', defaultMessage: 'You haven\'t blocked any users yet.' },
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
})
const mapStateToProps = (state) => ({
@@ -19,12 +21,8 @@ const mapStateToProps = (state) => ({
})
const mapDispatchToProps = (dispatch) => ({
onFetchBlocks() {
dispatch(fetchBlocks())
},
onExpandBlocks() {
dispatch(expandBlocks())
},
onFetchBlocks: () => dispatch(fetchBlocks()),
onExpandBlocks: () => dispatch(expandBlocks()),
})
export default
@@ -61,6 +59,11 @@ class Blocks extends ImmutablePureComponent {
return (
<Block>
<div className={[_s.default, _s.px15, _s.py10, _s.justifyContentCenter].join(' ')}>
<Heading size='h2'>
{intl.formatMessage(messages.blocks)}
</Heading>
</div>
<ScrollableList
scrollKey='blocked_accounts'
onLoadMore={this.handleLoadMore}

View File

@@ -6,6 +6,7 @@ import { me } from '../initial_state'
import { fetchMutes, expandMutes } from '../actions/mutes'
import Account from '../components/account'
import Block from '../components/block'
import Heading from '../components/heading'
import ScrollableList from '../components/scrollable_list'
const mapStateToProps = (state) => ({
@@ -15,12 +16,8 @@ const mapStateToProps = (state) => ({
})
const mapDispatchToProps = (dispatch) => ({
onFetchMutes() {
dispatch(fetchMutes())
},
onExpandMutes() {
dispatch(expandMutes())
},
onFetchMutes: () => dispatch(fetchMutes()),
onExpandMutes: () => dispatch(expandMutes()),
})
export default
@@ -53,6 +50,11 @@ class Mutes extends ImmutablePureComponent {
return (
<Block>
<div className={[_s.default, _s.px15, _s.py10, _s.justifyContentCenter].join(' ')}>
<Heading size='h2'>
<FormattedMessage id='navigation_bar.mutes' defaultMessage='Muted users' />
</Heading>
</div>
<ScrollableList
scrollKey='mutes'
onLoadMore={this.handleLoadMore}

View File

@@ -180,19 +180,9 @@ class SwitchingArea extends PureComponent {
<WrappedRoute path='/search/hashtags' exact page={SearchPage} component={Search} content={children} />
<WrappedRoute path='/search/groups' exact page={SearchPage} component={Search} content={children} />
{ /*
<WrappedRoute path='/settings/account' exact page={SettingsPage} component={AccountSettings} content={children} />
<WrappedRoute path='/settings/profile' exact page={SettingsPage} component={ProfileSettings} content={children} />
<WrappedRoute path='/settings/relationships' exact page={SettingsPage} component={RelationshipSettings} content={children} />
<WrappedRoute path='/settings/development' exact page={SettingsPage} component={Development} content={children} />
<WrappedRoute path='/settings/billing' exact page={SettingsPage} component={Billing} content={children} />
*/ }
{ /* <WrappedRoute path='/settings/blocks' exact page={SettingsPage} component={BlockedAccounts} content={children} componentParams={{ title: 'Blocked Accounts' }} />
<WrappedRoute path='/settings/domain-blocks' exact page={SettingsPage} component={BlockedDomains} content={children} componentParams={{ title: 'Blocked Domains' }} />
<WrappedRoute path='/settings/filters' exact page={SettingsPage} component={Filters} content={children} componentParams={{ title: 'Muted Words' }} />
<WrappedRoute path='/settings/mutes' exact page={SettingsPage} component={Mutes} content={children} componentParams={{ title: 'Muted Accounts' }} /> */ }
<WrappedRoute path='/settings/blocks' exact page={SettingsPage} component={BlockedAccounts} content={children} componentParams={{ title: 'Blocked Users' }} />
<WrappedRoute path='/settings/mutes' exact page={SettingsPage} component={Mutes} content={children} componentParams={{ title: 'Muted Users' }} />
<Redirect from='/@:username' to='/:username' exact />
<WrappedRoute path='/:username' publicRoute exact page={ProfilePage} component={AccountTimeline} content={children} />