pleroma-fe/src/components/account_actions/account_actions.js

57 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-05-07 15:10:53 +02:00
import { mapState } from 'vuex'
2019-10-08 09:21:48 +02:00
import ProgressButton from '../progress_button/progress_button.vue'
2020-02-28 17:39:47 +01:00
import Popover from '../popover/popover.vue'
import UserListMenu from 'src/components/user_list_menu/user_list_menu.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faEllipsisV
} from '@fortawesome/free-solid-svg-icons'
library.add(
faEllipsisV
)
2019-10-08 09:21:48 +02:00
const AccountActions = {
props: [
2020-04-21 22:27:51 +02:00
'user', 'relationship'
2019-10-08 09:21:48 +02:00
],
data () {
2019-10-09 15:20:51 +02:00
return { }
2019-10-08 09:21:48 +02:00
},
components: {
2020-02-28 17:39:47 +01:00
ProgressButton,
Popover,
UserListMenu
2019-10-08 09:21:48 +02:00
},
methods: {
showRepeats () {
this.$store.dispatch('showReblogs', this.user.id)
},
hideRepeats () {
this.$store.dispatch('hideReblogs', this.user.id)
},
blockUser () {
this.$store.dispatch('blockUser', this.user.id)
},
unblockUser () {
this.$store.dispatch('unblockUser', this.user.id)
},
reportUser () {
this.$store.dispatch('openUserReportingModal', { userId: this.user.id })
2020-05-07 15:10:53 +02:00
},
openChat () {
this.$router.push({
name: 'chat',
2022-05-25 19:34:26 +02:00
params: { username: this.$store.state.users.currentUser.screen_name, recipient_id: this.user.id }
2020-05-07 15:10:53 +02:00
})
2019-10-08 09:21:48 +02:00
}
2020-05-07 15:10:53 +02:00
},
computed: {
...mapState({
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
})
2019-10-08 09:21:48 +02:00
}
}
export default AccountActions