File tree Expand file tree Collapse file tree 5 files changed +68
-19
lines changed
components/Global/Elements Expand file tree Collapse file tree 5 files changed +68
-19
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
+ <div v-if =" service === 'users'" class =" columns is-mobile field has-text-centered" >
3
+ <div v-if =" BlockButton" >
4
+ <div class =" column control has-text-centered" >
5
+ <hc-button color =" button"
6
+ :disabled =" blacklistPending"
7
+ :isLoading =" blacklistPending"
8
+ @click =" toggleBlacklist" >
9
+ <template v-if =" isBlacklisted " >
10
+ <hc-icon icon =" ban" :class =" ['icon-left', 'is-danger']" /> {{ $t('component.blacklist.buttonLabelUnblock') }}
11
+ </template >
12
+ <template v-else >
13
+ <hc-icon icon =" ban" class =" icon-left" /> {{ $t('component.blacklist.buttonLabelBlock') }}
14
+ </template >
15
+ </hc-button >
16
+ </div >
17
+ </div >
18
+ </div >
2
19
</template >
3
20
<script >
21
+ import {mapGetters } from ' vuex'
22
+ import blacklistable from ' ../../../mixins/blacklistable'
23
+
24
+ export default {
25
+ name: ' hc-block-button' ,
26
+ mixins: [blacklistable],
27
+ props: {
28
+ BlockButton: {
29
+ type: Boolean ,
30
+ default: false
31
+ },
32
+ entity: {
33
+ type: Object ,
34
+ required: true
35
+ },
36
+ service: {
37
+ type: String , // users, organizations
38
+ default: ' users'
39
+ }
40
+ },
41
+ data () {
42
+ return {
43
+ connected: false ,
44
+ ready: false
45
+ }
46
+ },
47
+ computed: {
48
+ ... mapGetters ({
49
+ loggedInUser: ' auth/user'
50
+ })
51
+ },
52
+ methods: {
53
+ author (){
54
+ return this .entity ;
55
+ },
56
+ }
57
+ }
4
58
</script >
59
+ <style lang="scss" scoped>
60
+ @import " assets/styles/utilities" ;
61
+
62
+
63
+ </style >
Original file line number Diff line number Diff line change 19
19
<hc-button color =" button is-fullwidth"
20
20
:class =" {'is-primary': !follow.isPending && !follow.isFollowing}"
21
21
@click =" toggleFollow"
22
- :disabled =" follow.isPending || isBlacklisted "
22
+ :disabled =" follow.isPending"
23
23
:isLoading =" follow.isPending" >
24
24
<template v-if =" follow .isFollowing " >
25
25
<hc-icon icon =" check" class =" icon-left" /> {{ $t('component.follow.buttonLabelUnFollow') }}
40
40
</hc-button >
41
41
</div >
42
42
</div >
43
- <div v-if =" service === 'users'" class =" columns is-mobile field has-text-centered" >
44
- <div class =" column control has-text-centered" >
45
- <hc-button color =" button"
46
- :disabled =" blacklistPending || follow.isFollowing"
47
- :isLoading =" blacklistPending"
48
- @click =" toggleBlacklist" >
49
- <template v-if =" isBlacklisted " >
50
- <hc-icon icon =" ban" :class =" ['icon-left', 'is-danger']" /> {{ $t('component.blacklist.buttonLabelUnblock') }}
51
- </template >
52
- <template v-else >
53
- <hc-icon icon =" ban" class =" icon-left" /> {{ $t('component.blacklist.buttonLabelBlock') }}
54
- </template >
55
- </hc-button >
56
- </div >
57
- </div >
58
43
</div >
59
44
</template >
60
45
61
46
<script >
62
47
import { mapGetters } from ' vuex'
63
- import blacklistable from ' ~/components/mixins/blacklistable'
64
48
65
49
export default {
66
50
name: ' hc-follow-buttons' ,
67
- mixins: [blacklistable],
68
51
props: {
69
52
showButtons: {
70
53
type: Boolean ,
Original file line number Diff line number Diff line change 51
51
"@nuxtjs/pwa" : " ~2.0.5" ,
52
52
"axios" : " ^0.18.0" ,
53
53
"babel-eslint" : " ~8.2.5" ,
54
+ "babel-plugin-transform-object-rest-spread" : " ^6.26.0" ,
54
55
"babel-preset-vue-app" : " ~2.0.0" ,
55
56
"body-parser" : " ~1.18.3" ,
56
57
"body-scroll-lock" : " ^2.4.6" ,
Original file line number Diff line number Diff line change 41
41
<hc-follow-buttons v-if =" user"
42
42
:showButtons =" !isOwner"
43
43
:entity =" user" />
44
+
45
+ <hc-block-button v-if =" user"
46
+ :BlockButton =" !isOwner"
47
+ :entity =" user" />
44
48
<div v-if =" false" class =" hc-shortcuts level under-construction" >
45
49
<!-- TODO: replace the cdn images with local hc icons -->
46
50
<div class =" level-item has-text-centered" >
140
144
import {mapGetters } from ' vuex'
141
145
import FollowerItem from ' ~/components/Profile/FollowerItem/FollowerItem.vue'
142
146
import FollowButtons from ' ~/components/Global/Elements/Follow/FollowButtons.vue'
147
+ import BlockButton from ' ~/components/Global/Elements/BlockButton/BlockButton'
143
148
import Map from ' ~/components/Map/Map.vue'
144
149
import Timeline from ' ~/components/layout/Timeline'
145
150
import Badges from ' ~/components/Profile/Badges/Badges'
150
155
components: {
151
156
' hc-follower-item' : FollowerItem,
152
157
' hc-follow-buttons' : FollowButtons,
158
+ ' hc-block-button' : BlockButton,
153
159
' hc-profile-badges' : Badges,
154
160
' hc-map' : Map ,
155
161
' hc-timeline' : Timeline
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ require('browser-env')()
6
6
// Setup vue files to be processed by `require-extension-hooks-vue`
7
7
hooks ( 'vue' ) . plugin ( 'vue' ) . push ( )
8
8
// Setup vue and js files to be processed by `require-extension-hooks-babel`
9
- hooks ( [ 'vue' , 'js' ] ) . plugin ( 'babel' ) . push ( )
9
+ hooks ( [ 'vue' , 'js' ] ) . plugin ( 'babel' , { plugins : [ 'transform-object-rest-spread' ] } ) . push ( )
You can’t perform that action at this time.
0 commit comments