2017-08-21 17:25:01 +00:00
|
|
|
import UserCardContent from '../user_card_content/user_card_content.vue'
|
2018-12-17 16:17:03 +00:00
|
|
|
import StillImage from '../still-image/still-image.vue'
|
2018-12-13 16:57:11 +00:00
|
|
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
2017-08-21 17:25:01 +00:00
|
|
|
|
|
|
|
const UserCard = {
|
|
|
|
props: [
|
|
|
|
'user',
|
2018-06-07 00:58:44 +00:00
|
|
|
'showFollows',
|
|
|
|
'showApproval'
|
2017-08-21 17:25:01 +00:00
|
|
|
],
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
userExpanded: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
2018-12-17 16:17:03 +00:00
|
|
|
UserCardContent,
|
|
|
|
StillImage
|
2017-08-21 17:25:01 +00:00
|
|
|
},
|
2018-12-13 17:41:36 +00:00
|
|
|
computed: {
|
|
|
|
currentUser () { return this.$store.state.users.currentUser }
|
|
|
|
},
|
2017-08-21 17:25:01 +00:00
|
|
|
methods: {
|
|
|
|
toggleUserExpanded () {
|
|
|
|
this.userExpanded = !this.userExpanded
|
2018-06-07 00:58:44 +00:00
|
|
|
},
|
|
|
|
approveUser () {
|
|
|
|
this.$store.state.api.backendInteractor.approveUser(this.user.id)
|
2018-06-07 01:24:31 +00:00
|
|
|
this.$store.dispatch('removeFollowRequest', this.user)
|
2018-06-07 00:58:44 +00:00
|
|
|
},
|
|
|
|
denyUser () {
|
|
|
|
this.$store.state.api.backendInteractor.denyUser(this.user.id)
|
2018-06-07 01:24:31 +00:00
|
|
|
this.$store.dispatch('removeFollowRequest', this.user)
|
2018-12-16 23:52:27 +00:00
|
|
|
},
|
2018-12-13 16:57:11 +00:00
|
|
|
userProfileLink (user) {
|
2018-12-26 13:50:48 +00:00
|
|
|
return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)
|
2017-08-21 17:25:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default UserCard
|