Finally, added BlockCard

This commit is contained in:
taehoon 2019-02-13 14:55:02 -05:00
parent 5d6e1864a5
commit 0220d3d304
4 changed files with 43 additions and 4 deletions

View File

@ -0,0 +1,21 @@
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
const BlockCard = {
props: ['user'],
data () {
return {
progress: false,
updated: false
}
},
components: {
BasicUserCard
},
methods: {
unblockUser () {
this.progress = true
}
}
}
export default BlockCard

View File

@ -0,0 +1,16 @@
<template>
<basic-user-card :user="user">
<template slot="secondary-area">
<button class="btn btn-default" @click="unblockUser" :disabled="progress">
<template v-if="progress">
{{ $t('user_card.unblock_progress') }}
</template>
<template v-else>
{{ $t('user_card.unblock') }}
</template>
</button>
</template>
</basic-user-card>
</template>
<script src="./block_card.js"></script>

View File

@ -5,13 +5,13 @@ import TabSwitcher from '../tab_switcher/tab_switcher.js'
import ImageCropper from '../image_cropper/image_cropper.vue' import ImageCropper from '../image_cropper/image_cropper.vue'
import StyleSwitcher from '../style_switcher/style_switcher.vue' import StyleSwitcher from '../style_switcher/style_switcher.vue'
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js' import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
import BasicUserCard from '../basic_user_card/basic_user_card.vue' import BlockCard from '../block_card/block_card.vue'
import withLoadMore from '../../hocs/with_load_more/with_load_more' import withLoadMore from '../../hocs/with_load_more/with_load_more'
import withList from '../../hocs/with_list/with_list' import withList from '../../hocs/with_list/with_list'
const UserList = withList(BasicUserCard, entry => ({ user: entry })) const BlockList = withList(BlockCard, entry => ({ user: entry }))
const BlockListWithLoadMore = withLoadMore( const BlockListWithLoadMore = withLoadMore(
UserList, BlockList,
(props, $store) => $store.dispatch('fetchBlocks'), (props, $store) => $store.dispatch('fetchBlocks'),
(props, $store) => get($store.state.users.currentUser, 'blocks', []) (props, $store) => get($store.state.users.currentUser, 'blocks', [])
) )

View File

@ -366,7 +366,9 @@
"muted": "Muted", "muted": "Muted",
"per_day": "per day", "per_day": "per day",
"remote_follow": "Remote follow", "remote_follow": "Remote follow",
"statuses": "Statuses" "statuses": "Statuses",
"unblock": "Unblock",
"unblock_progress": "Unblocking..."
}, },
"user_profile": { "user_profile": {
"timeline_title": "User Timeline" "timeline_title": "User Timeline"