aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-actor-image
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-02 13:46:09 +0200
committerChocobozzz <me@florianbigard.com>2022-05-02 13:46:09 +0200
commit4428ad543e0c717eb7edb27003b9d9a52c616d5d (patch)
tree950f225b265b9a523509afc5e9961fb5c07523e1 /client/src/app/shared/shared-actor-image
parent252e16e158d7a1e192126802d0ec32208f8f80be (diff)
downloadPeerTube-4428ad543e0c717eb7edb27003b9d9a52c616d5d.tar.gz
PeerTube-4428ad543e0c717eb7edb27003b9d9a52c616d5d.tar.zst
PeerTube-4428ad543e0c717eb7edb27003b9d9a52c616d5d.zip
Fix avatar responsive
Diffstat (limited to 'client/src/app/shared/shared-actor-image')
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.ts16
1 files changed, 11 insertions, 5 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 b2e1ef46e..600984aa2 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
@@ -23,7 +23,7 @@ export class ActorAvatarComponent {
23 23
24 @Input() previewImage: string 24 @Input() previewImage: string
25 25
26 @Input() size: ActorAvatarSize = '32' 26 @Input() size: ActorAvatarSize
27 27
28 // Use an external link 28 // Use an external link
29 @Input() href: string 29 @Input() href: string
@@ -50,13 +50,13 @@ export class ActorAvatarComponent {
50 } 50 }
51 51
52 get defaultAvatarUrl () { 52 get defaultAvatarUrl () {
53 if (this.account) return Account.GET_DEFAULT_AVATAR_URL(+this.size) 53 if (this.account) return Account.GET_DEFAULT_AVATAR_URL(this.getSizeNumber())
54 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL(+this.size) 54 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL(this.getSizeNumber())
55 } 55 }
56 56
57 get avatarUrl () { 57 get avatarUrl () {
58 if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account, +this.size) 58 if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account, this.getSizeNumber())
59 if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel, +this.size) 59 if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel, this.getSizeNumber())
60 60
61 return '' 61 return ''
62 } 62 }
@@ -88,6 +88,12 @@ export class ActorAvatarComponent {
88 return !!this.account || !!this.channel 88 return !!this.account || !!this.channel
89 } 89 }
90 90
91 private getSizeNumber () {
92 if (this.size) return +this.size
93
94 return undefined
95 }
96
91 private getColorTheme () { 97 private getColorTheme () {
92 const initialLowercase = this.initial.toLowerCase() 98 const initialLowercase = this.initial.toLowerCase()
93 99