aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-15 14:59:25 +0200
committerChocobozzz <me@florianbigard.com>2022-06-16 11:37:08 +0200
commit5b0ec7cddb1ae6dbd2057f067382866f846b882c (patch)
tree5751d96ec4ab0d49b793c4ff1c8edbc8daeab6ac /client/src/app/shared/shared-actor-image/actor-avatar.component.ts
parentb13a0a48bacb53e65e665774e621326452045294 (diff)
downloadPeerTube-5b0ec7cddb1ae6dbd2057f067382866f846b882c.tar.gz
PeerTube-5b0ec7cddb1ae6dbd2057f067382866f846b882c.tar.zst
PeerTube-5b0ec7cddb1ae6dbd2057f067382866f846b882c.zip
Increase global font size
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.ts24
1 files changed, 12 insertions, 12 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 600984aa2..fa4f1e51f 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
@@ -1,4 +1,4 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input, OnChanges } from '@angular/core'
2import { VideoChannel } from '../shared-main' 2import { VideoChannel } from '../shared-main'
3import { Account } from '../shared-main/account/account.model' 3import { Account } from '../shared-main/account/account.model'
4 4
@@ -15,7 +15,7 @@ export type ActorAvatarSize = '18' | '25' | '28' | '32' | '34' | '35' | '36' | '
15 styleUrls: [ './actor-avatar.component.scss' ], 15 styleUrls: [ './actor-avatar.component.scss' ],
16 templateUrl: './actor-avatar.component.html' 16 templateUrl: './actor-avatar.component.html'
17}) 17})
18export class ActorAvatarComponent { 18export class ActorAvatarComponent implements OnChanges {
19 private _title: string 19 private _title: string
20 20
21 @Input() account: ActorInput 21 @Input() account: ActorInput
@@ -42,6 +42,8 @@ export class ActorAvatarComponent {
42 return '' 42 return ''
43 } 43 }
44 44
45 classes: string[] = []
46
45 get alt () { 47 get alt () {
46 if (this.account) return $localize`Account avatar` 48 if (this.account) return $localize`Account avatar`
47 if (this.channel) return $localize`Channel avatar` 49 if (this.channel) return $localize`Channel avatar`
@@ -68,20 +70,18 @@ export class ActorAvatarComponent {
68 return name.slice(0, 1) 70 return name.slice(0, 1)
69 } 71 }
70 72
71 getClass (type: 'avatar' | 'initial') { 73 ngOnChanges () {
72 const base = [ 'avatar' ] 74 this.classes = [ 'avatar' ]
73 75
74 if (this.size) base.push(`avatar-${this.size}`) 76 if (this.size) this.classes.push(`avatar-${this.size}`)
75 77
76 if (this.channel) base.push('channel') 78 if (this.channel) this.classes.push('channel')
77 else base.push('account') 79 else this.classes.push('account')
78 80
79 if (type === 'initial' && this.initial) { 81 if (!this.avatarUrl && this.initial) {
80 base.push('initial') 82 this.classes.push('initial')
81 base.push(this.getColorTheme()) 83 this.classes.push(this.getColorTheme())
82 } 84 }
83
84 return base
85 } 85 }
86 86
87 hasActor () { 87 hasActor () {