diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-02-22 14:54:12 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-02-22 14:54:12 +0000 |
| commit | e34e1ccdae06302ee734414267a357ff5b7c888c (patch) | |
| tree | f1882a022a155a10ad10a3bb92d75f6a4a1f7f5a /src/components/user_settings/user_settings.js | |
| parent | 3768a4623fc227614b0b3920c2cb92ca16404a69 (diff) | |
| parent | 22851a3a967cc5364a95c71bda48eccc3808bf41 (diff) | |
Merge branch '227-manage-blocks-mutes' into 'develop'
Add Blocks / Mutes management tabs under user settings page
See merge request pleroma/pleroma-fe!578
Diffstat (limited to 'src/components/user_settings/user_settings.js')
| -rw-r--r-- | src/components/user_settings/user_settings.js | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 904060b2..06e72112 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -1,9 +1,33 @@ -import { unescape } from 'lodash' +import { compose } from 'vue-compose' +import unescape from 'lodash/unescape' +import get from 'lodash/get' import TabSwitcher from '../tab_switcher/tab_switcher.js' import ImageCropper from '../image_cropper/image_cropper.vue' import StyleSwitcher from '../style_switcher/style_switcher.vue' import fileSizeFormatService from '../../services/file_size_format/file_size_format.js' +import BlockCard from '../block_card/block_card.vue' +import MuteCard from '../mute_card/mute_card.vue' +import withSubscription from '../../hocs/with_subscription/with_subscription' +import withList from '../../hocs/with_list/with_list' + +const BlockList = compose( + withSubscription({ + fetch: (props, $store) => $store.dispatch('fetchBlocks'), + select: (props, $store) => get($store.state.users.currentUser, 'blockIds', []), + childPropName: 'entries' + }), + withList({ getEntryProps: userId => ({ userId }) }) +)(BlockCard) + +const MuteList = compose( + withSubscription({ + fetch: (props, $store) => $store.dispatch('fetchMutes'), + select: (props, $store) => get($store.state.users.currentUser, 'muteIds', []), + childPropName: 'entries' + }), + withList({ getEntryProps: userId => ({ userId }) }) +)(MuteCard) const UserSettings = { data () { @@ -41,7 +65,9 @@ const UserSettings = { components: { StyleSwitcher, TabSwitcher, - ImageCropper + ImageCropper, + BlockList, + MuteList }, computed: { user () { |
