aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-17 14:42:53 +0200
committerChocobozzz <me@florianbigard.com>2021-08-18 08:35:06 +0200
commit9df52d660feb722404be00a50f3c8a612bec1c15 (patch)
treedde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/shared/shared-actor-image/actor-avatar.component.ts
parentadb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff)
downloadPeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip
Migrate client to eslint
Diffstat (limited to 'client/src/app/shared/shared-actor-image/actor-avatar.component.ts')
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.ts36
1 files changed, 18 insertions, 18 deletions
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
index b06c2bae6..a4adfd1b7 100644
--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
@@ -17,6 +17,8 @@ export type ActorAvatarSize = '18' | '25' | '32' | '34' | '36' | '40' | '100' |
17 templateUrl: './actor-avatar.component.html' 17 templateUrl: './actor-avatar.component.html'
18}) 18})
19export class ActorAvatarComponent { 19export class ActorAvatarComponent {
20 private _title: string
21
20 @Input() account: ActorInput 22 @Input() account: ActorInput
21 @Input() channel: ActorInput 23 @Input() channel: ActorInput
22 24
@@ -33,8 +35,6 @@ export class ActorAvatarComponent {
33 this._title = value 35 this._title = value
34 } 36 }
35 37
36 private _title: string
37
38 get title () { 38 get title () {
39 if (this._title) return this._title 39 if (this._title) return this._title
40 if (this.account) return $localize`${this.account.name} (account page)` 40 if (this.account) return $localize`${this.account.name} (account page)`
@@ -50,22 +50,6 @@ export class ActorAvatarComponent {
50 return '' 50 return ''
51 } 51 }
52 52
53 getClass (type: 'avatar' | 'initial') {
54 const base = [ 'avatar' ]
55
56 if (this.size) base.push(`avatar-${this.size}`)
57
58 if (this.channel) base.push('channel')
59 else base.push('account')
60
61 if (type === 'initial' && this.initial) {
62 base.push('initial')
63 base.push(this.getColorTheme())
64 }
65
66 return base
67 }
68
69 get defaultAvatarUrl () { 53 get defaultAvatarUrl () {
70 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL() 54 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL()
71 55
@@ -86,6 +70,22 @@ export class ActorAvatarComponent {
86 return name.slice(0, 1) 70 return name.slice(0, 1)
87 } 71 }
88 72
73 getClass (type: 'avatar' | 'initial') {
74 const base = [ 'avatar' ]
75
76 if (this.size) base.push(`avatar-${this.size}`)
77
78 if (this.channel) base.push('channel')
79 else base.push('account')
80
81 if (type === 'initial' && this.initial) {
82 base.push('initial')
83 base.push(this.getColorTheme())
84 }
85
86 return base
87 }
88
89 hasActor () { 89 hasActor () {
90 return !!this.account || !!this.channel 90 return !!this.account || !!this.channel
91 } 91 }